No announcement yet.

Vbulletin 5, how to hide forum sub-categories on home page ?

  • Filter
  • Time
  • Show
Clear All
new posts

  • [vB5] Vbulletin 5, how to hide forum sub-categories on home page ?

    Vbulletin 5, how to hide forum sub-categories on home page ?

    Good day to all vbulletin geeks

    Any idea on how to hide all forum sub-categories and their sub-categories from the home page ?

    We are using Vbulletin 5 default style.

    We will answer the funny unintuitive question before someone will have the first honor ;
    Well of course you must have guessed it :
    We simply have too many sub-categories which makes the main page look too long

    This is the case scenario :
    We have 5 main categories ACTING AS CATEGORIES “not channels”
    Under each we have about 5 sub-categories , also ACTING AS CATEGORIES “not channels”
    Then finally under each we have about 5 sub categories, those are already ACTING AS CHANNELS “meaning user can post”

    So again to further clarify “we want to hide all sub-categories and their sub-categories from the main or home page, thus leaving only the main categories to display on the home page, so the rest of sub-categories and their sub-categories and channels are viewable only when the user clicks any of the main categories URLS thus navigating to that particular main category forum URL
    Any ideas ? most importantly not a JAVA SCRIPT because it wouldn’t be compatible with some browsers
    Also hopefully a direct edit to the vB5 DEFAULT STYLE templates and not a css_additional.css ?

  • #2
    Seven Skins from posted a brilliant solution

    Originally posted by Seven Skins
    May be you are looking for this ...

    edit display_Forums_list template and comment out this block of code. This code is from vb 5.3.4

    HTML Code:
            <vb:if condition="!empty($forum['subchannels'])">
                <!-- Sub-Forums -->
                <tr class="subforum-list"><td colspan="4">
                    <div class="subforum-header h-clear">{vb:rawphrase sub_forums}:</div>
                    {vb:set cols, 1}
                    <vb:each from="forum.subchannels" value="subforum">
                        <vb:if condition="(($cols - 1) % $subChannelsPerRow == 0)">
                        {vb:set colspan, ''}
                        <vb:if condition="($cols == count($forum['subchannels'])) AND (($remaining = ($cols % $subChannelsPerRow)) != 0)">
                            {vb:set colspan, {vb:concat 'colspan="', {vb:math {vb:raw subChannelsPerRow} - {vb:raw remaining} + 1}, '"'}}
                                <td class="subforum-item" data-lastcontent="{vb:raw subforum.lastcontent.created}" data-channel-id="{vb:raw subforum.nodeid}" {vb:raw colspan}>
                                    <div class="subforum-info">
                                        <span class="icon<vb:if condition="!empty($subforum['is_new'])"> new</vb:if>"></span>
                                        <a href="{vb:url {vb:raw subforum.routeid}}" class="subforum-title">{vb:raw subforum.title}</a>
                                        <span class="counts">({vb:number {vb:raw subforum.topics}}/{vb:number {vb:raw subforum.posts}})</span>
                        <vb:if condition="($cols % $subChannelsPerRow == 0) OR $cols == count($forum['subchannels'])">
                        {vb:set cols, {vb:math {vb:var cols} + 1}}

    But works only on the last most level channels "where users could post" , but still leaves behind the 2nd level sub categories "the middle"

    Our forum topics hierarchy is MAIN CATEGORY "no post"--- > SUB CATEGORY "no post" ---> finally the CHANNELS "which the above solution was successful in hiding from the forum home page"

    So our issue now is how to hide also the SUB CATEGORY "no post", thus the home page to display only the MAIN CATEGORIES "the top most parent of all the SUB CAT.'s and CHANNELS


    • #3
      You could try to set the display order in the channel-manager to 0! This should do it...Did not try if the channels displayed in the main-categories then...


      Display OrderSet to '0' to not display this item

      If not...

      If you do edit the standard-template you have to repeat this after every update! You could load it but hide it with css if it is an option for you.

      .subforum-list {display:none}
      I don't think it causing any other template than the main-forumlist (channelid 1) but I don't look deeper into that.

      If you want to hide that only at the channelid 1 and wanna be sure about that, you could do it in a new template with a condition like

      HTML Code:
      <vb:if condition="$page['channelid'] == 1"><style>.subforum-list {display:none}</style></vb:if>
      and a hook for this template to footer_before_body_end.

      Modifing a vb-template is the last I will do, if I could do it in any other ways.
      Last edited by delicjous; Thu 28th Dec '17, 2:54am. Reason: Was writen with smartphone.. so I correct some code-parts closed!


      • #4
        Thanks for the kind suggestions , but none of this was successful in simply hiding off of the home page, ALL forum categories that match the following criteria :

        - none root , meaning they are children of one or more categories up above

        Thus leaving only behind on the home page the forum categories that match the following criteria :

        - root , meaning not children of any forum

        NOTE setting display order to 0 simply disables TOTALLY a forum , our objective is only HIDE from view in the main / home page , but appear normally in the next view when you click on any of the MAIN FORUMS that are left visible on the home page


        Related Topics