How to show sub-categories as home page?
-
I have a few cateogories, but some has also subcategories (sub-forums) inside. I want to skow these subcategories as home page, where we can't write a post outside any category.
One image tells better what I want:
I want to remove all the buttons (New topic, etc) and the block without posts "There are no topics in this category. Why don't you try posting one?"
And push up the sidebar widgets, all the same as main page.
Thanks
-
Subcategories are created in the header, not the content section, which is why the sidebar doesn't line up.
You could try disabling everyone's ability to create topics in that main category. You might still see that message, but your users wouldn't (I think).
-
Hello, I've changed lavender's
category.tpl
file, changed 2 things,- Sidebar is In line, like in home, and subcategories and current category are both at left.
- Added a class to category stuff that allows to hide buttons and posts via css. It is quite workaround but is working.
file is here:
http://paste.ubuntu.com/9377817/The class name is: .category-stuff-id-{cid} where {cid} is the number of category to be hidden (you can see category id in the browser's address bar after
/category/
), via admin panel, exemple, like in my test if one wants to hide category 22 , the person goes to "admin panel" -> "appearance" - > "custom css & html", and add a line at the end:.category-stuff-id-22 { display: none; }
To use the file change
/nodebb/node_modules/nodebb-theme-lavender/templates/category.tpl
for it and then restart nodebb.edit: if it is not working maybe you need to clear your browser's cache or use incognito mode to test it!!
-
Please use this instead
https://github.com/kassius/nodebb-theme-aspic/blob/master/templates/category.tpl
The other will not expand if you have no widgets.
-
The trick is more simple. Thanks to your suggestion, I have the latests lavender theme (2.2.3) and modify only one line in
category.tpl
from this
<div class="category row">
to this:
<div class="category row category-stuff-id-{cid}">
There is no need to add
subcatcat-container
nor other stuff. Get the clean file and change only this line. This works for me because I no want show widget under subcategory