The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Personalize sub-forums display [All version's]

View previous topic View next topic 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 :
{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}

And replace them with :
Code:
<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
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 :
Code:
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







APE
Manager
Manager

Male Posts : 8339
Reputation : 718
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

View previous topic View next topic Back to top


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