Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Problem with Main and Child Categories

edited January 2012 in Vanilla 2.0 - 2.8

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

Answers

  • Options

    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.

  • Options

    Ok thats fine..

    But what about stripping the word category form the permalinks?

  • Options
    JongosJongos
    edited January 2012

    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.

  • Options
    JongosJongos
    edited January 2012

    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.

  • Options

    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?

  • Options
    JongosJongos
    edited January 2012

    @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 :)

  • Options
    JongosJongos
    edited January 2012 Answer ✓

    @keshavhl

    Dude, I've submitted an addon that allows listing of subcategories inside Discussions page of a Category.

    Subcategories

  • Options

    @Jongos Good One. Will give it a try...

  • Options
    hbfhbf wiki guy? MVP
Sign In or Register to comment.