Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • juls_m Friend
    #840359

    Hello

    I am using Uber template and I have been trying to add a background image to a custom html module, using the "JA extra field" tab, but the picture doesn’t show. It’s like the module cannot "read" the instruction to load the image, just as if I hadn’t selected one at all.
    Can you advise on this please?

    Thank you!

    Giulia

    Saguaros Moderator
    #840688

    Hi Giulia,

    There are 2 ways you can follow in this case:

    1. User default option for background image of Custom HTML module: in the `Options’ tab of this module, you can set background image there: http://prntscr.com/9n2bds

    2. If you want to set via JA Extra Fields option:
      • Go to file: ROOT/templates/uber/etc/form/mod_custom.xml
    • Add additional fields for background:

      <field name="module-background" type="media" default="" label="TPL_MENU_ITEM_MODULE_BACKGROUND_LABEL" description="TPL_MENU_ITEM_MODULE_BACKGROUND_DESC" ></field>
      <field name="module-background-size" type="text" default="cover" label="TPL_MENU_ITEM_MODULE_BACKGROUNDSIZE_LABEL" description="TPL_MENU_ITEM_MODULE_BACKGROUNDSIZE_DESC" ></field>
      <field name="module-background-position" type="text" default="center center" label="TPL_MENU_ITEM_MODULE_BACKGROUNDPO_LABEL" description="TPL_MENU_ITEM_MODULE_BACKGROUNDPO_DESC" ></field>

      it will look like this: http://prntscr.com/9n2bs5

    • Override the Custom HTML module by creating this directory: ROOT/templates/uber/html/mod_custom

    • Copy the file: ROOT/modules/mod_custom/tmpl/default.php

    and paste into ROOT/templates/uber/html/mod_custom/ you just created above

    • Open that file: ROOT/templates/uber/html/mod_custom/default.php

    change:

    <div class="custom<?php echo $moduleclass_sfx ?>" <?php if ($params->get('backgroundimage')) : ?> style="background-image:url(<?php echo $params->get('backgroundimage');?>)"<?php endif;?> >
        <?php echo $module->content;?>
    </div>

    To:

    <div class="custom<?php echo $moduleclass_sfx ?>" <?php if ($params->get('module-background')) : ?> style="background-image:url(<?php echo $params->get('module-background');?>)"<?php endif;?> >
        <?php echo $module->content;?>
    </div>

    Then you can add background image via JA Extra Field tab.

    Hope this helps.

    juls_m Friend
    #841805
    This reply has been marked as private.
    Saguaros Moderator
    #843896

    You can send me URL, Admin and FTP account of your site via your post and SET IT AS PRIVATE reply (only Moderators and Staff can see it)

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 3 replies, has 2 voices, and was last updated by  Saguaros 8 years, 4 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum