Top Tier Category - ignored in MultiSearch search results

2 posts by 2 authors in: Forums > CMS Builder
Last Post: August 10, 2012   (RSS)

Re: [zick] Top Tier Category - ignored in MultiSearch search results

By Jason - August 10, 2012

Hi,

Sure, to create your list field, you can use the "Get options from MYSQL query (advanced)" option.

You can then use a query like this:

SELECT name, name
FROM `<?php echo $TABLE_PREFIX ?>businesses`
WHERE depth = 0


A depth of 0 indicates a top level category

I don't think there would be a way to default to the child's parent record without using a custom plugin.

If the entire purpose of this is for searching for records based on their parent, there may be an easier way.

If in your search field you output a drop down list with only top level categories, and use the "num" field as a value, you can then search against the "parentNum" field in your category section. Top level categories have no value for parentNum, so you wouldn't need to worry about filtering those out.

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/