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.

'Split' category display aka category tabs (alternative to true subcategories?)

TomTesterTomTester New
edited June 2007 in Vanilla 1.0 Help
Just an idea... since so many people ask for addition of subcategories. Perhaps we could
have an add-on to split categories across several 'category tabs'?

Example: Let's say a site has discussions on food (breakfast lunch dinner, best restaurants)
and drink (best bars, best cocktails, etc.)

Presently the admin can either set up TWO categories (#1 food and #2 drink)
or many separate categories (grouped by a common 'main' category), e.g.
food - breakfast
food - lunch
food - dinner
food - best restaurants
drink - best bars
drinks - cocktails

The split category display add-on would allow the admin to
a - Hide the full category display tab (optional, could require page manager)
b - Create a 'Drink' tab as well as a 'Food' tab (optional: specify different color)
c - Select the categories to assigned to each (optional: allow overlap*)

(*) re overlap: in example above a "best of" tab could be used to group the
categories # best restaurants and # best bars

Any comments/ideas? Jazzman available perhaps to add this to page manager?


  • Options
    Is there a way to display a category on another page? Such as if I have an announcements category and I want it to be displayed on my welcome page which ppl see when they type in the url.It just has to display the category, you dont have to be able to post on it or anything if it is complicated, it just has to be viewable, it is for guests. Can this be done?
  • Options
    I've written a category hider extension which will remove as many categories from the discussions page as are specified in it, but if you navigate to the category directly it will show the categorie's discussions.

    It is in working condition, but not what I consider complete.
  • Options
    TomTesterTomTester New
    edited November 2006
    Nice. It might help a little, but what I'd really want is some code that I can include in the a 'new' tab
    created by pagemanager to display selected categories. I have to dive into the Vanilla code I guess,
    I'm being lazy ;-)
  • Options
    bump di bump bump
  • Options
    I really need to play with pagemanager sometime.

    But without it, I suppose you could do a $Menu->AddTab('Category Name', $CategoryID, $CategoryURL) for each category you want to tabify.

    Maybe I'll build this into the hider when I get a round toit
  • Options
    edited November 2006
    re-reading your original post, if you want multiple categories in each tab, you would have to block all categories except the ones you want when that tab is active.

    i.e. given food and drink tabs, with Mexican, Italian, Chineese foods and Beer, Soda, Tea drinks, the food tab should block the drink categories and the drink tab should block the food categories. Maybe put a variable in place of the arrays in the category hider, then some kind of test to see which tab is clicked to store the appropriate IDs in the array.

    Untested code:$Menu->AddTab('Food', 'food', GetUrl($Configuration, 'index.php', '', '', '', '', 'PostBackAction=FoodTab'); $Menu->AddTab('Drink', 'drink', GetUrl($Configuration, 'index.php', '', '', '', '', 'PostBackAction=DrinkTab'); if ( ('index.php' == $Context->SelfUrl) && ForceIncomingString('CategoryID', '') == '') ) { if ('FoodTab' == ForceIncomingString('PostBackAction', '') { $BlockedCategories = array('4','5','6'); } if ('DrinkTab' == ForceIncomingString('PostBackAction', '') { $BlockedCategories = array('1','2','3'); } function Category_HideFromDiscussions(&$DiscussionManager) { $SB = &$DiscussionManager->DelegateParameters['SqlBuilder']; foreach ( $BlockedCategories as $CurrentBlock ) { $SB->AddWhere('t', 'CategoryID', '', $CurrentBlock, '<>', 'and', '', 0, 0); } } $Context->AddToDelegate('DiscussionManager', 'PostGetDiscussionBuilder', 'Category_HideFromDiscussions'); $Context->AddToDelegate('DiscussionManager', 'PreGetDiscussionCount', 'Category_HideFromDiscussions'); }
  • Options
    I'll test it tonight
  • Options
    How'd you go with this Tom?
This discussion has been closed.