1 ===================================
2 EXTENSION INSTALLATION INSTRUCTIONS
3 ===================================
5 In order for Vanilla to recognize an extension, it must be contained within its own directory within the extensions directory. So, once you have downloaded and unzipped the extension files, you can then place the folder containing the default.php file into your installation of Vanilla. The path to your extension's default.php file should look like this:
7 /path/to/vanilla/extensions/SubCategories/default.php
9 Once this is complete, you can enable the extension through the "Manage Extensions" form on the settings tab in Vanilla.
11 Make sure you have the most up to date version by checking Settings > Updates & Reminders > Check for updates now (and setting reminders).
13 The latest zip will be in the lussumo.com add-on repository:
15 http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=312
18 ================================
19 CREATING SUB-(-SUB...)CATEGORIES
20 ================================
22 Creating a sub-category is easy, just create a category in the normal way but place dash-spaces ("- ", minus the quotes) infront of it's name.
24 You can now embed unlimited levels of sub-categories by appending more dash-spaces infront of category names; the more dash-spaces, the lower down the hierachy the category falls. A simplistic example of multiple embedded sub-categories goes like so:
29 - - - Sub Sub Sub Category
31 You should make sure that your order is correct, otherwise some may not display.
34 =================================
35 THEMING YOUR NEW (SUB-)CATEGORIES
36 =================================
38 To override the look (theme) of sub-categories, copy the following file into your theme folder and then edit it:
40 /path/to/vanilla/extensions/SubCategories/theme/sub-categories.php
42 You can alter where this appears by overriding the name of the delegate it attaches to in your settings.php file (if you don't know what a delegate is, don't alter it). The variable is:
44 $Configuration['SUBCATEGORIES_DELEGATE']
46 It defaults to "PreRender".
48 To add the amount of sub-categories a category has to the category list, you need to edit your categories.php theme file, you should add below:
50 <li class="CategoryDiscussionCount">
51 <span>'.$this->Context->GetDefinition('Discussions').'</span> '.$Category->DiscussionCount.'
56 $CategoryList .= ' <li class="CategoryDiscussionCount">
57 <span>'.$this->Context->GetDefinition('SubCategories').'</span> '.SubCategoryCount($Category->CategoryID).'
60 If you wish to have the discussion count of the category include all sub-categories discussion counts, you should change the line:
62 <span>'.$this->Context->GetDefinition('Discussions').'</span> '.$Category->DiscussionCount.'
67 <span>'.$this->Context->GetDefinition('Discussions').'</span> '.SubDiscussionCount($Category->CategoryID).'
69 This is just an example of how you can change the default Vanilla theme to include updated discussion and sub-category counts.
76 SubCategories is currently maintained by Adam Dunkley - adam [at] webality [dot] co [dot] uk