Personalize sub-forums display [All version's]

Go down

Personalize sub-forums display [All version's]

Post by APE on December 8th 2014, 7:09 pm

  Personalize sub-forums display  

This tutorial will allow you to customize the display of sub-forums on the index of your forum.

Template modification

Administration Panel Display  Templates  General

Regardless of your forum version, look for the following variables in your Index_box template :

And replace them with :
<div class="s_forum">{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}</div>

Remember to save and publish your template. Add

Creation of JavaScript

Administration Panel  Modules  HTML & JAVASCRIPT  JavaScript codes management
Make sure javascript code management is enabled, and create a new script.

Title : what ever you like
Placement : In the home page
Add the following Code
$(function() {  
  var sep = '/', max_by_line = 3;
  $('.s_forum').each(function() {  
    var nth = 0;  
    $('a.gensmall', this).each(function(){  
      var next = this.nextSibling;
      if (next && next.nodeType == 3 && next.nodeValue == ", ") {  
        if (++nth % max_by_line) $(next).replaceWith(sep);
        else $(next).replaceWith('<br>');

You can customize the code by editing the following variables :

Right now max_by_line is set to 3, so this is what it will look like :

To modify the code look for this part of the JavaScript :
var sep = '/', max_by_line = 3;

Changing max_by_line from 3 to 2 will display the sub-links as :

And changing it to 1 will display them as :

Changing the / in sep to something like > will change the separator like below.

Now it's your turn Wink


Male Posts : 12139
Reputation : 1241
Language : fluent in dork / mumbojumbo & English haha

Back to top Go down

Back to top

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