Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

SubCategories

12467

Comments

  • Okay, this release should provide fixes for the above.
  • Brilliant! It's working fine.
  • Before I start, just like to let everyone know my first experience with Vanilla was a hot 30 minutes ago, so as far as newbies go, I'm the perfect definition. My questions: 1. Anyway to get an aggregate of the 30 latest discussions within child categories and display them on the parent category page? 2. How do you reference the parent category when building the headline for child category pages? In other words, how do you generate "Parent > Child : Entry"? Finally, this is outside the scope of this plugin but does involve it: 3. If I wanted to limit the drop down list of available categories to child categories only when creating a discussion within the parent / child category, which theme files should I look to modify? Other than that, this plugin is brilliant, I love the "- " for sub categories.
  • Hello cowboystyle, welcome. To your questions...

    1. This currently isn't possible. It would be doable, but would be quite a mission due to the complexity of having unlimited levels of attachment (if that makes sense). Perhaps someone might like to undertake this as an extension with a requirement of the SubCategories extension?

    2. Due to the nature of how Vanilla allows extensions to interact with the core (you are quite removed, and can only dip in at designated points to alter things) I had to do this by forceably altering the titles before they got rendered in the theme (it was best for compatibility). As such, it is quite difficult to alter how this works (you would need to modify my extension). Though, in the future, I would consider changing how this functions if more pragmatic suggestions are made.

    3. I am not sure if this is doable through theming. You would need to use an extension to overload the GetDiscussionForm function in the DiscussionForm class, it wouldn't be pretty.

    I think I can see what you want to get out of the SubCategories extension. It is doable, but not very easily... it might take creating an extension purely tailored to your requirement. One extension that might help that I am working on an update for at the moment, is MultiRoles - which I hope to provide the ability to make categories read only. That way you would be able to control where people post to through permissions.

    Hmm, I am being a bit incoherent, I apologise.

    Adam.
  • @angelic_venus: Thanks for the pointers and prompt response, I completely understood everything you said. 1. I could definitely see this as a plugin, something like SubCategoryAggregate, I'll take a look at how the discussions.php does it's magic and maybe come up with something. 2. I only ask, because on the discussions page I'd like to present a complete category trace , as I have sub categories with the same name. 3. The limit on child categories would be for presentation purposes only, I don't require a strict enforcement, I'll take a look behind the scenes and see whats up.
  • This might be a bug, but it looks like Sub-Categories aren't viewable on the parent category page until you manually move the the child under the parent on the category creation page.
  • Yes, I would quite like to attach categories at the very top of the list, but due to the way that I remove sub categories from the main list (using a reg exp that looks for categories with a lack of "- " at the beginning of category names) it would be quite difficult. I think them not being displayed unless you attach them to a parent (by reordering them to be below a main category) reinforces how the system works anyways.

    Adam.
  • Adam: Just finished the alpha version of an XML RPC interface for some common functions for Vanilla, one of the functions being Category Creation. I can't get it to work with SubCategories (that is categories added with "- " don't register as sub categories) and I'm not quite sure where to begin for adding subcategories. Any advice?
  • Sent it out, thanks for the prompt reply whoops, whispered, ignore
  • Uploaded version 0.2.2 of SubCategories.
  • Version number changed from 0.2.2 to 0.2.3.
  • SubCategories does not detect child categories with same name like so: Dakota - North - South Carolina - North - South Carolina's children will never show up, so I came up with a quick fix which passes around the Category object instead of just relying on the name. Quick fix to detect SubCategories with same names: In "default.php": ln160 : function IsSubCategory($Category, $CurrentName = '', $Zealous = false) { ln165 : $Level = CategoryLevel($Category->Name); ln172 : $Parent = GetParent($Category->CategoryID, $Category->Name, $Level); ln326 : if(IsSubCategory($DiscussionGrid->Category)) { In "sub-categories.php": ln41 : if(IsSubCategory($Category, $CurrentName)) {
  • I think I may have found another bug. If you use the symbol ' & ' as in a category name the category doesnt show up. You end up having to write AND instead.
  • Okay, I will look in to these =), cheers guys.

    Adam.
  • Whoops, note on my quick fix, throws an error when using strict error detection, use this instead: ln137 : function CategoryLevel($CategoryName = '') { ln165 : $Level = CategoryLevel(@$Category->Name);
  • Would it be possible to list the sub-categories on the main Category tab/page? I would like to have them displayed, as clicking into the categories first, then seeing the subtopics does not let you quickly peruse all available topics at a glance. To clarify, what I am asking if it is possible to have the Main Category page display in nested format all of the Categories, sub-cat topics. Thanks!!
  • Currently not Democritus, because of the way I forcefully remove the categories on the main categories page. I have paused work on SubCats for the moment so that I can finish off some other stuff to be able to get my forum live. I will perhaps look in to your suggestion at a later day.

    As for the bug fixes, I should have some time to work on them soon.

    Adam.
  • Hey, thanks for quick reply. Completely understood. Will wait or find someone within my discussion group to hack at it. Demo-
  • I'm sorry to call the emperor naked but apart from making things disappear in the categories page how is this different from just creating normal categories (albeit with a dash in front of their name)? The children seem not to inherit any of their parents access privileges and people can post in the parent just like a normal category. sorry if I'm missing the point here
  • This is not about inheriting permissions, it is a stylistic change and only a stylistic change, it is designed to be a simplistic solution to SubCategories within Vanilla.

    Adam.
Sign In or Register to comment.