'where' in Category Section
2 posts by 2 authors in: Forums > CMS Builder
Last Post: June 8, 2010 (RSS)
By aev - June 8, 2010
Hi,
I'm trying to use a 'where' statement to filter records in a Category Section, but I'm getting this error when viewing the webpage:
Category Viewer (nav1) errors
Unknown option 'where' specified
Valid option names are: (tableName, useSeoUrls, debugSql, selectedCategoryNum, categoryFormat, loadUploads, defaultCategory, rootCategoryNum, ulAttributes)
Here's my code:
How can I solve this?
-aev-
I'm trying to use a 'where' statement to filter records in a Category Section, but I'm getting this error when viewing the webpage:
Category Viewer (nav1) errors
Unknown option 'where' specified
Valid option names are: (tableName, useSeoUrls, debugSql, selectedCategoryNum, categoryFormat, loadUploads, defaultCategory, rootCategoryNum, ulAttributes)
Here's my code:
list($productoverviewRecords, $productoverviewSelectedCategory) = getCategories(array(
'tableName' => 'nav1',
'where' => 'template="product" and _isFirstChild="1"',
'defaultCategory' => 'none', // Enter 'first', a category number, or leave blank '' for none
'categoryFormat' => 'showall' // showall, onelevel, twolevel
));
How can I solve this?
-aev-
Re: [aev] 'where' in Category Section
By Jason - June 8, 2010
Hi,
There isn't an option in getCategories that allows for a "where" statement. What you could do is select all of the categories, then filter out the ones you don't want when you're doing your foreach loop.
Hope this helps.
There isn't an option in getCategories that allows for a "where" statement. What you could do is select all of the categories, then filter out the ones you don't want when you're doing your foreach loop.
Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/