![]() |
Thread Title color code by forum id
Hi All,
I would like to colour code Thread Titles according to what forum they are posted in. I have found this which is aimed at color coding threads from specific forumids in search results, will this work for forums in general and if so where do i need to put it? <vb:if condition="$show['forumlink'] AND in_array($thread['forumid'], array(x,y,z))">style="color: #123456"</vb:if> |
|
This only allows for thread types to be prefixed and color coded, I am wanting to color code thread titles different colors based on what forum they are in for example.
In the For Sale forum I would like all threat titles to be Blue In the Wanted forum I would like all thread titles to be Red etc etc |
Just add a class to the title and use CSS.
class="title{vb:raw thread.forumid}" Then define title1 (title2, title3, etc.) in the additional.css template edit: Actually, adding the class may not be necessary as the forumid may be already there. A link to your site and the page you want to change the titles on would help. |
Thanks Lynne,
Can you give me an example of how it should look Here is the page I want all thread title to appear blue: http://www.australianreptileforum.co...p?122-Reptiles and here is the page i want all thread titles to appear Red: http://www.australianreptileforum.co...php?124-Wanted |
I guess the forumid isn't used as an id on the forumdisplay page. So, modify the FORUMDISPLAY template and add it as a class to the<body> tag - <body class="forum{vb:raw forumid}"> - and then in additional.css you can add something like:
.forum122 .threadbit a.title {color: blue;} .forum124 .threadbit a.title {color: red;} |
Thanks Lynne this worked great
Is there a way to make it show the threat colours regardless of where the thread is displayed, e.g in Searches or in a Master Forum where all threads are displayed? |
I would think so, using a similar method to what I outlined. Without a link to the page, and a description of exactly what you want, I can't be more specific.
|
Hi Lynne,
This is the other site I am working on at the moment this is the Master forum using this mod: https://vborg.vbsupport.ru/showthread.php?t=245839 All forum threads are displayed here I want the For Sale threads to show blue here and the Wanted Threads to show Red etc http://reptilesdownunder.com/rdu/for...al-Classifieds |
I don't know that mod, but I am guessing you can modify it to put the forumid in there also and then do the CSS like I posted already.
|
Thanks Lynne, I will try and find where I can add the code above to the mod
--------------- Added [DATE]1344124552[/DATE] at [TIME]1344124552[/TIME] --------------- The Master forum appears as its own forum so this won't work, is there any way to adapt the code above to set title colour by prefix id? |
I honestly don't know since I do not know the code at all. You would need to look and see what the code is like and you may be able to apply a class based on the prefixid which you could then write some CSS for.
|
All times are GMT. The time now is 06:58 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|