-
AuthorPosts
-
January 6, 2016 at 6:20 pm #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 ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
January 7, 2016 at 7:02 am #840688Hi Giulia,
There are 2 ways you can follow in this case:
-
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
- 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.
January 8, 2016 at 11:10 am #841805This reply has been marked as private.Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
January 11, 2016 at 8:59 am #843896You 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)
-
AuthorPosts
This topic contains 3 replies, has 2 voices, and was last updated by Saguaros 9 years ago.
We moved to new unified forum. Please post all new support queries in our New Forum