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

Currently I have 2 menus, a top and a bottom, set up as separate Category sections so they can be displayed separately. But to avoid confusion, I want to set up only 1 menu section and have a list field named "Position" and be able to select either Top or Bottom.

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: [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

Hi atomicrabbit,

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!
All the best,
Chris

Re: [chris] Unknown option 'where' specified

Hey Chris,
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

Hi atomicrabbit,

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.
All the best,
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

>Is 'rootCategoryNum' a new option in the latest version ?

Yes, that was added in v1.30
Dave Edis - Senior Developer
interactivetools.com