by Ange Tuteur October 18th 2015, 10:33 pm
Hi
@ProfaneValkyrie,
I apologize for the late response. Try following instead :
Go to Modules > JavaScript codes management and create a new script with the following settings.
Placement : In the homepage OR In all pages if you want it to affect sub-forums.
- Code:
$(function() {
var forums = {
3 : 'forum-class'
};
for (var a = $('.forumtitle'), i = 0, j = a.length, k; i < j; i++) {
for (k in forums) {
if (k == a[i].href.replace(/.*?\/f(\d+)-.*/, '$1')) {
$(a[i]).closest('.row')[0].className += ' ' + forums[k];
break;
}
}
}
});
At the top of the script is an object :
- Code:
var forums = {
3 : 'forum-class'
};
In that object you should include the id of the forum + the class you want added to this forum, in short :
id:class pairs. As you can see by the current state above, forum "3" will have the class "forum-class" added to it. If we want to add more forums, we need to add a comma after our last pair and create a new pair :
- Code:
var forums = {
3 : 'forum-class',
5 : 'forum-5'
};
Now forum "5" will have the class "forum-5" which allows us to use CSS to style the background of the row :
- Code:
li.row.forum-5 {
background:url('IMAGE') repeat 0% 0% #000;
}
Some things to note :
1. Class names cannot contain spaces. Classes with spaces are interpreted as multiple classes.
2. You can find the forum ID by looking at the URL while viewing the forum.
/fXX-forum-title the
XX being a number that represents the forum ID.
If any questions let me know.