Topic Title Colour in Search List
2 posters
Page 1 of 1
Topic Title Colour in Search List
Hi guys,
How do I get the Topic Titles in the 'latest posts' and 'today's topics' lists to show up in their respective colours?
For example, I have set topics within a particular forum to show up with blue titles. And in that forum they are displayed correctly. (i.e. blue - see below)
But in the latest/today's topics Lists, they just show up the same colour as every other topic. (i.e. purple - see below)
What I want is for certain forums to have their topic titles in specific colours and for these colours to show up in the topic titles in the search lists, so they are not all the same colour. This will be much more interesting to the eye and will help members.
Is this possible?
Thanks.
How do I get the Topic Titles in the 'latest posts' and 'today's topics' lists to show up in their respective colours?
For example, I have set topics within a particular forum to show up with blue titles. And in that forum they are displayed correctly. (i.e. blue - see below)
But in the latest/today's topics Lists, they just show up the same colour as every other topic. (i.e. purple - see below)
What I want is for certain forums to have their topic titles in specific colours and for these colours to show up in the topic titles in the search lists, so they are not all the same colour. This will be much more interesting to the eye and will help members.
Is this possible?
Thanks.
SophieDophs- Forumember
- Posts : 375
Reputation : 3
Language : English
Re: Topic Title Colour in Search List
Hi @SophieDophs,
Which method are you using the color the topic titles, is it the default color list or JavaScript ? It's most likely possible to change the color of titles on the search page by checking the forum they're in. ( it's right below the topic title )
Go to Modules > JavaScript codes management and create a new script
Placement : In all the pages
You'll see the following in the script above.
f43 is the ID of the forum and '# FF0000' is the color I've associated that forum with. Each forum should be separated by a comma, like in the example above. To find the forum ID, simply go to the forum and copy the ID from your addressbar :
You can replace the example forum IDs and colors with your own, and add to the list as well.
Which method are you using the color the topic titles, is it the default color list or JavaScript ? It's most likely possible to change the color of titles on the search page by checking the forum they're in. ( it's right below the topic title )
Go to Modules > JavaScript codes management and create a new script
Placement : In all the pages
- Code:
/\/search/.test(window.location.pathname) && $(function() {
var forums = {
f43 : '#FF0000',
f45 : '#00FF00',
f46 : '#0000FF'
}, r = $('.dterm'), i = 0, j = r.length, k;
for (; i<j; i++) for (k in forums) r[i].lastChild.lastChild.href.match(/f\d+/)[0] == k && (r[i].getElementsByTagName('DIV')[0].firstChild.firstChild.style.color = forums[k]);
});
You'll see the following in the script above.
- Code:
var forums = {
f43 : '#FF0000',
f45 : '#00FF00',
f46 : '#0000FF'
},
f43 is the ID of the forum and '# FF0000' is the color I've associated that forum with. Each forum should be separated by a comma, like in the example above. To find the forum ID, simply go to the forum and copy the ID from your addressbar :
You can replace the example forum IDs and colors with your own, and add to the list as well.
Similar topics
» Automatic topic list search?
» Search only searches Topic Title??
» Poll Title Colour
» Title which has an underscore does not appear in the search engine.
» Chatbox - Set text colour & member list groups
» Search only searches Topic Title??
» Poll Title Colour
» Title which has an underscore does not appear in the search engine.
» Chatbox - Set text colour & member list groups
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum