PDA

View Full Version : Multiple styles in index


j1mmy
06-20-2009, 02:12 AM
I know it is possible to apply certain styles to certain fourms, but how can I apply multiple styles to each forum and have the forum respective styles presented on the forum index page?

It's really just changing the colour for each forum for me...

j1mmy
06-21-2009, 01:21 PM
Bump...

Lynne
06-21-2009, 03:21 PM
I cannot picture what you want. Perhaps you can post some images of what you are wanting.

j1mmy
06-21-2009, 03:29 PM
Okay, for example this website (http://thepsychologyforum.com) has blue table headers for each forum. What I want is for each forum to have their own colour. So for e.g. website lounge would be blue, psychology topics would be red etc. And of course when you click a certain forum, it would be displayed in its respective colour.

Lynne
06-21-2009, 03:41 PM
I suppose you can find the template that spits out the table header and then add a conditon - if forumid=xx then add a style tag to the table that is the color you want. Or just add a class to it like class="mycolor$forumid" and then add these classes to the bottom of Main CSS. However, I know of no way to automatically do this. You're gonna have to make template edits and such.

j1mmy
06-21-2009, 07:07 PM
I know what the template is, it's forumbit_level1_nopost.

But I've never worked with if tags before, so wouldn't know how to write it at all. I'm not quite sure what you mean by the class="mycolor$forumid" solution.,,

Lynne
06-21-2009, 07:18 PM
Just add it into these areas:

<td class="thead mycolor$forumid" etc
And then define class .mycolor4 for when it is forumid 4, and .mycolor10 for when it is forumid 10, etc.

j1mmy
06-21-2009, 09:04 PM
Right, so where would that go in the template?

<tbody>
<tr>
<td colspan="<if condition="$vboptions[showmoderatorcolumn]">4<else />3</if>">
<!-- forcing space -->
<img src="$vboptions[cleargifurl]" width="1" height="5" />
</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="tcat" colspan="<if condition="$vboptions[showmoderatorcolumn]">4<else />3</if>">
<if condition="$childforumbits">
<a style="float:$stylevar[right]" href="#top" onClick="return toggle_collapse('forumbit_$forumid')"><img id="collapseimg_forumbit_$forumid" src="$stylevar[imgdir_button]/collapse_tcat{$collapseimg_forumid}.gif" alt="" border="0" /></a>
</if>
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
<if condition="$show['forumdescription']"><span class="smallfont" style="font-weight:normal;">- $forum[description]</span></if>
<if condition="$show['subforums']"><div class="smallfont"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
</tr>
</tbody>
<tbody>
<tr align="center">
<td class="thead" >&nbsp;</td>
<td class="thead" width="100%" align="$stylevar[left]">$vbphrase[forum]</td>
<td class="thead" width="175">$vbphrase[last_post]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td class="thead">$vbphrase[moderator]</td>
</if>
</tr>
</tbody>
<if condition="$childforumbits">
<tbody id="collapseobj_forumbit_$forumid" style="{$collapseobj_forumid}">
$childforumbits
</tbody>
</if>

Lynne
06-22-2009, 03:37 AM
Right, so where would that go in the template?
In this area:

<tbody>
<tr align="center">
<td class="thead" >&nbsp;</td>
<td class="thead" width="100%" align="$stylevar[left]">$vbphrase[forum]</td>
<td class="thead" width="175">$vbphrase[last_post]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td class="thead">$vbphrase[moderator]</td>
</if>
</tr>
</tbody>

j1mmy
06-22-2009, 11:41 AM
Could you give me an example (with colors and forumid's) of how the line of code is written exactly? Then I can copy it to the other forums. The way I wrote it doesn't work at all.

Lynne
06-22-2009, 03:34 PM
It's always best if you post what you did so we can help you fix it. You aren't going to learn as much if I just tell you exactly what to do.

Here is what I am talking about doing. I stated it in post 7 above:
<td class="thead mycolor$forumid" >&nbsp;</td>


If you add that to the lines, you should then be able to go into your source code and see lines such as (Psychology Website Lounge):
<td class="thead mycolor1" >&nbsp;</td>

and in the next section (Psychology Topics):
<td class="thead mycolor5" >&nbsp;</td>


So looking at the source code shows you the classes you then need to define in your Main CSS - from above, you need to define .mycolor1 and .mycolor5

j1mmy
06-22-2009, 05:16 PM
I can see the lines such as Psychology Website Lounge etc in the source code. But that source code is based on the above template, forumbit_level1_nopost.

So in that template would I need to add that code 4 times (as there are 4 different forums?)

Also, how would I define this in the CSS? Would it be like

.mycolor1 {

color:#FFF

Also, above in your example, you haven't specified the forumid?

--------------- Added 1245706039 at 1245706039 ---------------

Any further suggestions?

smartkidbk5
06-23-2009, 04:17 AM
First Make Multiple Styles with different colors...then:

AdminCP>Forum Manager>Select Forum & Click Edit
Style Options: Select Style for the forum
Override Users' Style Choice: Yes

j1mmy
06-23-2009, 11:45 AM
First Make Multiple Styles with different colors...then:

AdminCP>Forum Manager>Select Forum & Click Edit
Style Options: Select Style for the forum
Override Users' Style Choice: Yes
What I am trying to do is get the styles to display themselves all on the index page. Usually vB only allows one style to be shown on the home page, not multiple.

Lynne
06-23-2009, 02:00 PM
I can see the lines such as Psychology Website Lounge etc in the source code. But that source code is based on the above template, forumbit_level1_nopost.

So in that template would I need to add that code 4 times (as there are 4 different forums?)

Also, how would I define this in the CSS? Would it be like

.mycolor1 {

color:#FFF

Also, above in your example, you haven't specified the forumid?

--------------- Added 22 Jun 2009 at 14:27 ---------------

Any further suggestions?
The forumid gets spit out with the code. That's why I told you to view your page source and get the colors that are spit out in it.

This may help with your css - http://www.w3schools.com/Css/pr_background-color.asp

j1mmy
06-24-2009, 12:01 PM
Well this is what the source is generating on my index, but no colors?

<!-- BEGIN TEMPLATE: forumhome_forumbit_level1_nopost -->
<tbody>
<tr>
<td colspan="3">
<!-- forcing space -->

<img src="clear.gif" width="1" height="5" />
</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="tcat" colspan="3">

<a style="float:right" href="#top" onClick="return toggle_collapse('forumbit_1')"><img id="collapseimg_forumbit_1" src="images/fun/buttons/collapse_tcat.gif" alt="" border="0" /></a>

<a href="forumdisplay.php?f=1">Psychology Website Lounge</a>



</td>
</tr>
</tbody>
<tbody>
<tr align="center">
<td class="thead" >&nbsp;</td>
<td class="thead" width="100%" align="left">Forum</td>
<td class="thead" width="175">Last Post</td>

</tr>

</tbody>

<tbody id="collapseobj_forumbit_1" style="">
<!-- BEGIN TEMPLATE: forumhome_forumbit_level2_post -->