Selecting Category List Top Level

5 posts by 2 authors in: Forums > CMS Builder
Last Post: June 7, 2011   (RSS)

Re: [theclicklab] Selecting Category List Top Level

By robin - June 6, 2011

Hey Jan,

You might be able to stay with using getRecords(), and just add make a change to your where. To just show the top level we can use a depth condition. Something like:

list($yachtsRecords, $yachtsMetaData) = getRecords(array(
'tableName' => 'yachts',
'where' => "type LIKE '$numType' AND active='1' AND hide='0' AND depth='0'",
'useSeoUrls' => true,
'allowSearch' => false,
));


I cleaned up the quotes a little bit too.

Hope that helps,
Robin
Robin
Programmer
interactivetools.com

Re: [robin] Selecting Category List Top Level

By theclicklab - June 6, 2011

Hi robin, that gives me the following error:

MySQL Error: Unknown column 'depth' in 'where clause'

Any other suggestions?

Many Thanks
Jan

Re: [theclicklab] Selecting Category List Top Level

By robin - June 7, 2011

Hey Jan,

That's surprising that there is no depth column in a category section. Yachts is a category section right?

Thanks,
Robin
Robin
Programmer
interactivetools.com

Re: [robin] Selecting Category List Top Level

By theclicklab - June 7, 2011

Hi robin, yes you are correct, it is the destination table that is a category table not the yacht table - my bad. I have put in a quote request for assistance as I am a bit swamped at the moment. Thanks Jan.