Problem with Main and Child Categories
So finally I started building my forum on vanilla platform but I have a problem correctly nesting main and child categories.
I have created a main category "Members Area" and under this category I have added three child categories "Introduction" "Links" and "Site News". As per the rule of forum structure, when I click on main category i.e. "Members Area", it should load its child categories on the page but instead the main category is acting like a forum category where you can post a new topic.
I checked the option "Display root categories as headings" to prevent main category from being acting as a forum category but doing so prevents the main category to display its description.
The second issue is related to permalinks. How can I remove the slug "Category" from the category permalinks?
Best Answer
-
Jongos ✭
Dude, I've submitted an addon that allows listing of subcategories inside Discussions page of a Category.
0
Answers
About main category not showing child categories.
I guess that is the default behavior of Vanilla. That's how it is.
To change so that Vanilla show child categories inside a main category Discussions view, you have to install a plugin, which i think you have to write one.
Some already talk about it here.
For my project, I will need that too...
Once you got that sorted out, I think you could use category user rights assignment to disallow posting inside certain category (read : main category), if that's how you want it to be.
Ok thats fine..
But what about stripping the word category form the permalinks?
this answer comes from a noob... (that's me)
Vanilla (to be precise actually it's Garden) makes decision based on the URL requested by browser.
If you remove "Category" from the permalink, it won't know if you're requesting the Category page.
yourdomain.com/application/controller/argument1/argument2/argument3/argument4....
that is the schema for Vanilla URL routing.
For Dashboard the URL is :
yourdomain.com/dashboard
However for Vanilla, the application slug has been made to default to Vanilla. Unless the first slug requested contains the name of an enabled application, a request always goes to Vanilla
yourdomain.com/vanilla/ is the same as yourdomain.com/
If the url is : yourdomain.com/conversations , it won't take you to Vanilla because there is an application named Conversations.
If you remove Category from a category page URL, how would it know you want to direct the request thru a category controller (class.categorycontroller.php)?
You might have to hack the routing to put a fallback default controller, though it's not guaranteed that it's possible.
i might be wrong, but that's how I understand it.
There's an alternative though...
You have to register every category you have into the Routes setting (Dashboad>Routes)
Say you have category called "All about cats"
the URL would be yourdomain,com/forum/category/all-about-cats
you want it to be yourdomain,com/forum/cats
you set into Routes manager
Route Expression: cats
Target: category/all-about-cats
Type: internal
Do that for every category you have.
Thanks for the info Jongos.. That really showed me a path.
If I register all my categories through routes then will that data be safe during vanilla upgrade or do I have to do it again if I upgrade my vanilla software?
@keshavhl
It's stored in your /conf/config.php
if you could recognize the pattern, maybe you could generate it in excel.
as I've said, I'm a newbie too... so take my advice at your own discretion
@keshavhl
Dude, I've submitted an addon that allows listing of subcategories inside Discussions page of a Category.
Subcategories
@Jongos Good One. Will give it a try...
interesting. I may have to test this one out too
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained