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?)
TomTester
New
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
etc.
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?
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
etc.
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?
0
This discussion has been closed.
Comments
It is in working condition, but not what I consider complete.
created by pagemanager to display selected categories. I have to dive into the Vanilla code I guess,
I'm being lazy ;-)
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
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'); }