Need help with filtered dropdown category list.
1 posts by 1 authors in: Forums > CMS Builder
Last Post: December 10, 2011 (RSS)
By rconring - December 10, 2011 - edited: December 10, 2011
I have numerous list pages on a website sharing a common navigation category table. I have a Dynamic Drive horizontal multi-level menu working fine with the categories table and calling the appropriate list page for each. Here is where I am stuck. Each of the various list tables has a "category" field and is verified against the common navigation table. In the CMSB admin, I need to filter the dropdown in each of the record update forms to only display the sub-categories for that particular table. I have it now displaying the entire navigation table by using the "Get options from database (Advanced)" option (See attached image) but need to filter to only one sub-category using the "Get options from MySql Query".
I notice that the criteia I need is in the lineage field. For instance (See attached search list image) the lineage for the New Photo Galleries starts with ":5:4:" so would I be able to use that in a where clause to only display the sub-categories for New Photo Galleries? If so, what would the code look like to do that?
Well, never mind .... unless there is a better way! I fixed it by using the following syntax in the query:
SELECT num, breadcrumb
FROM `<?php echo $TABLE_PREFIX ?>navigation`
WHERE lineage LIKE '%:5:4:%';
When all else fails, consult the documentation! It took me a few failed attempts but finally got it working.
Thanks anyway!
I notice that the criteia I need is in the lineage field. For instance (See attached search list image) the lineage for the New Photo Galleries starts with ":5:4:" so would I be able to use that in a where clause to only display the sub-categories for New Photo Galleries? If so, what would the code look like to do that?
Well, never mind .... unless there is a better way! I fixed it by using the following syntax in the query:
SELECT num, breadcrumb
FROM `<?php echo $TABLE_PREFIX ?>navigation`
WHERE lineage LIKE '%:5:4:%';
When all else fails, consult the documentation! It took me a few failed attempts but finally got it working.
Thanks anyway!
Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987