XF 2.1 Is there a way to hide subforums from the top level?

Hey there Harvey,

There are ways to hide your forums or nodes as they are called in the administrator control panel. You will need to adjust the node permissions for viewing.

However, I'd like to better understand your request, when you say "top level" do you mean the forum main index?
 
Yes the main index.

When I check the box to hide it you can't see it when you click into the forum.

So I want all top level forums to be visible at the forum "home page" but sub forums visible when you click into a specific forum.

Thank you!
 
Search for extra.less found under Admin CP > Appearance > Templates and then add this code:

Code:
.nodeList .subForumsPopup
{
    display: none;
}
 
Last edited:
I found sub forum display style and tried each of the three options and couldn't get it to work?
 

Attachments

  • Screen Shot 2020-07-17 at 10.43.46 AM.webp
    Screen Shot 2020-07-17 at 10.43.46 AM.webp
    13.8 KB · Views: 19
Sorry Harvey, I gave you the wrong code before.

Try this in your extra.less file:

CSS:
.node-subNodeMenu {
display: none
}

The sub forum will still be visible only if you go inside the parent forum.
 
I tried it both ways (with the ; and without it) and cleared cache in both Firefox and Chrome it still shows. I assume with the ; is correct?

"Gear for Sale" is the subforum I am trying to hide on the top level.
 

Attachments

  • Screen Shot 2020-07-17 at 10.56.20 AM.webp
    Screen Shot 2020-07-17 at 10.56.20 AM.webp
    30.9 KB · Views: 19
How do I make it a sub forum? I just made it a child of the forum above it.

Also how do I find the node number?
When you go to Admin CP > Forums > Nodes then click on a forum, check the URL. Inside, it will say name.ForumID

In this case, all you'll need to do though is modify the parent node for Gear for Sale after clicking into it from that page.
 
Last edited:
I already have it set I think (see attachement).
 

Attachments

  • Screen Shot 2020-07-17 at 11.06.31 AM.webp
    Screen Shot 2020-07-17 at 11.06.31 AM.webp
    20.8 KB · Views: 17
  • Screen Shot 2020-07-17 at 11.06.09 AM.webp
    Screen Shot 2020-07-17 at 11.06.09 AM.webp
    5.2 KB · Views: 15
Good. Now if you want to hide the sub-forum list, do the code I told you about:

extra.less
CSS:
.node-subNodeMenu {
display: none
}

This will remove the sub-forum list from the main index and will only display Gear for Sale forum when you click into Gear X.
 
Top Bottom