
rconring
User
Dec 10, 2011, 6:22 PM
Post #1 of 1
(633 views)
Shortcut
|
|
Need help with filtered dropdown category list.
|
Can't Post
|
|
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! Ron Conring Conring Automation Services ---------------------------------------- Software for Business and Industry Since 1987
(This post was edited by rconring on Dec 10, 2011, 6:53 PM)
|