PDA


View Full Version : module background colour


bouncingpeanut
11-30-2005, 04:28 PM
I want to add a new module - but still use the module shell.. but is there a way just for this one module I can change the background to white instead of the blueygrey colour - I like the blueygrey colour for the rest so don't want this to be permenant, i.e I don't want to change any of the other modules. I just wondered whether in just this code I could add something so the background displays white?

I've got this code

picture.jpgloads of words blah blah l. .... <a href="http://mymessageboard/forumdisplay.php?f=86">More</a>

Hope this isn't too much of a daft question.

deadhippo
12-01-2005, 01:42 PM
This is a great question. I too would like to change the background color and also the padding of particular modules but not of modules in general.

Brian
12-01-2005, 05:04 PM
Is there any reason you couldn't just copy the contents of the adv_portal_module_shell template and use that as the base for your new module? That would probably be the easiest way. If that wouldn't work about the next best way would be to use an <if condition> that looks something like this:

<if condition="$mods['modid'] == X">yourclasshere<else />$bgclass</if>

deadhippo
12-01-2005, 10:43 PM
Thats sounds like a great idea....unfortinately I have no idea how to do that

is there a guide somewhere here that will show the variables that need to be changed to alter the background colour and also the padding

This is the code for the adv_portal_module_shell

$mods[formcode]
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat" colspan="$mods[colspan]">
<if condition="$vba_style['portal_collapsemods']">
<a href="#top" onclick="return toggle_collapse('module_$mods[collapse]')" style="float:$stylevar[right]"><img alt="" border="0" id="collapseimg_module_$mods[collapse]" src="$stylevar[imgdir_button]/collapse_tcat$modimgcollapse.gif" /></a>
</if>
<span class="smallfont"><strong>$vba_style[portal_blockbullet] <if condition="$mods['link']"><a href="$mods[link]">$mods[title]</a><else />$mods[title]</if></strong></span></td>
</tr>
</thead>
<tbody id="collapseobj_module_$mods[collapse]" style="$modcollapse">
<if condition="$show['tablerow']">
<tr>
<td class="$bgclass">
$modulehtml
</td>
</tr>
<else />
$modulehtml
</if>
</tbody>
</table>
<div><img src="$vboptions[bburl]/$vboptions[cleargifurl]" height="$vba_style[portal_vspace]" alt="" /></div>

<if condition="$mods['formcode']"></form></if>

deadhippo
12-02-2005, 11:25 PM
Well, this is the process I am using to create a custom module.
1 I went to Style Manager.
2 From drop down menu, I chose Edit Templates
3 Double clicked adv_portal_module_shell
4 Returned to Style Manager
5 From the drop down menu I chose Add New Templates
6 I entered adv_portal_module_shell_white_bkd as the title
7 I then pasted the above code (original unaltered code) and pressed save
8 I got the following result

http://i9.photobucket.com/albums/a55/deadhippo/Temp%20Files%20Folder/custom_template.jpg

9 Clicked Add module
10 Chose Template
11 I used the title White Background Test, (center column display order 3)
12 In Template to include i added module_shell_white_bkd to adv_portal_
13 I chose No for Use Module Shell Template
14 I pressed Save
15 I got the following successful result

http://i9.photobucket.com/albums/a55/deadhippo/Temp%20Files%20Folder/a_white_module.jpg

16 I clicked on my page to check it and it changed from

http://i9.photobucket.com/albums/a55/deadhippo/Temp%20Files%20Folder/page_before.jpg

to

http://i9.photobucket.com/albums/a55/deadhippo/Temp%20Files%20Folder/page_after.jpg

17 Also I don't know how to add content from here.

Brian
12-03-2005, 05:13 PM
When you're adding a new template module only the code that is added to the template you've added is going to be displayed. So if you need to add content, it would need to be added to your 'adv_portal_module_shell_white_bkd' template that you just created.

deadhippo
12-05-2005, 11:27 AM
When you're adding a new template module only the code that is added to the template you've added is going to be displayed. So if you need to add content, it would need to be added to your 'adv_portal_module_shell_white_bkd' template that you just created.

Thanks for that vital piece of information
so that means the template isnt really a template

how about which parts of the code i have to change to get rid of the padding and to make the background white?

Also why do you think the text from the preceding module repeated?

Brian
12-05-2005, 03:09 PM
Thanks for that vital piece of information
so that means the template isnt really a template
I'm not following your logic there...


how about which parts of the code i have to change to get rid of the padding and to make the background white?
Just change the cellpadding and cellspacing values in the table tag for the padding, and change $bgclass in the <td> tag to a new class or add a background color instead.

Also why do you think the text from the preceding module repeated?
Once you remove the '$modulehtml' variable from your template and replace it with the content you want displayed then that will keep it from repeating. Since the news story was the last value that was set for the variable $modulehtml though, that's why it gets repeated when you use that variable in your template.