Topic Title Colour in Search List

Go down

In progress Topic Title Colour in Search List

Post by SophieDophs on March 1st 2015, 4:26 pm

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?


Female Posts : 374
Reputation : 2
Language : English

Back to top Go down

In progress Re: Topic Title Colour in Search List

Post by Ange Tuteur on March 1st 2015, 10:00 pm

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
/\/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] = forums[k]);

You'll see the following in the script above.
  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.
Ange Tuteur

Male Posts : 13202
Reputation : 2917
Language : EN10, FR5, JA5
Location : Macungie, PA

Back to top Go down

Back to top

Permissions in this forum:
You cannot reply to topics in this forum