Unknown option 'where' specified
8 posts by 3 authors in: Forums > CMS Builder
Last Post: September 10, 2009 (RSS)
By atomicrabbit - September 6, 2009 - edited: September 6, 2009
This is all fine, except the getCategories function doesn't support the 'where' option. I get this error if I use the 'where' option:
Unknown option 'where' specified
This is my code:
list($categoryRecords, $selectedCategory) = getCategories(array(
'tableName' => 'menu',
'categoryFormat' => 'showall',
'where' => 'position="top"',
));
Is this at all possible? My other option would be just to query the entire category section and just do an if statement for the top and bottom menus... for example, for the top menu, I would do something like this.
//top menu
foreach ($categoryRecords as $categoryRecord):
if ($categoryRecord['position'] == "top") {
//display item
}
endforeach;
But I'd really prefer a more graceful solution.
/atomicrabbit
Re: [atomicrabbit] Unknown option 'where' specified
By Chris - September 7, 2009 - edited: September 7, 2009
How about setting up two top-level categories in your section: "Top Menu" and "Bottom Menu", then assigning all your records underneath to either one or the other. You can supply the "rootCategoryNum" option to getCategories, supplying the "num" of either your "Top Menu" or "Bottom Menu" record, which would return all the records underneath.
Personally, I'd be tempted to keep them as separate sections and use a Menu Group to keep them conceptually together, which might be simpler.
I hope this helps (and makes sense!) Please let me know if you'd like me to go into more detail or if you have any more questions.
Chris
Re: [chris] Unknown option 'where' specified
Personally, I'd be tempted to keep them as separate sections and use a Menu Group to keep them conceptually together, which might be simpler.
can you explain this in more detail? Not sure I understand.
Re: [atomicrabbit] Unknown option 'where' specified
By Chris - September 7, 2009
Menu Groups are a new feature introduced in v1.33. They allow you to group related menu items. To create one:
Admin > Section Editors > Add New Editor...
Select "Menu Group" under <Advanced Menus> and give your group a name (e.g. "Menus"). Then you'd simply drag your TopMenu and BottomMenu sections (or whatever they're called) underneath your new Menu Group.
Keeping things organized like this might help avoid confusion. I hope this helps!
Chris
Re: [chris] Unknown option 'where' specified
I'm currently using v1.26, do paid users get free upgrades? and if so, can I upgrade without breaking anything in the process?
Re: [atomicrabbit] Unknown option 'where' specified
By Chris - September 9, 2009
Upgrades are by donation.
We try our best to prevent our upgrades from breaking any existing functionality, but it's always best to take backups of everything just in case.
Chris
Re: [chris] Unknown option 'where' specified
How about setting up two top-level categories in your section: "Top Menu" and "Bottom Menu", then assigning all your records underneath to either one or the other. You can supply the "rootCategoryNum" option to getCategories, supplying the "num" of either your "Top Menu" or "Bottom Menu" record, which would return all the records underneath.
Ok I was playing around with this... and I keep getting this error:
Unknown option 'rootCategoryNum' specified
Is 'rootCategoryNum' a new option in the latest version ?
Re: [atomicrabbit] Unknown option 'where' specified
By Dave - September 10, 2009
Yes, that was added in v1.30
interactivetools.com