Show sub types in navigation with linked lists

5 posts by 2 authors in: Forums > CMS Builder
Last Post: December 8, 2009   (RSS)

Re: [benedict] Show sub types in navigation with linked lists

Hi guys,

Any word on this?

Re: [benedict] Show sub types in navigation with linked lists

By Chris - December 8, 2009

Hi benedict,

So right now, you've got your categories hard-coded?

<ul class="side-nav">
<li><a href="products.php?product_type=Accessories">Accessories</a></li>
<li><a href="products.php?product_type=Axes">Axes</a></li>
<li><a href="products.php?product_type=Blowers">Blowers</a></li>
<li><a href="products.php?product_type=Brush Cutters - Line Trimmers">Brush Cutters - Line Trimmers</a></li>
<li><a href="products.php?product_type=Chain Saws">Chain Saws</a></li>
<li><a href="products.php?product_type=Construction Equipment">Construction Equipment</a></li>
<li><a href="products.php?product_sub_type=Generators">Generators</a></li>
<li><a href="products.php?product_type=Hand Tools&product_sub_type=Gloves">Gloves</a></li>
<li><a href="products.php?product_type=Hand Tools">Hand Tools</a></li>
<li><a href="products.php?product_sub_type=Hedge Trimmers">Hedge Trimmers</a></li>
<li><a href="products.php?product_type=Mowers">Mowers</a></li>
<li><a href="products.php?product_type=Blowers">Mulchers - Chipper Choppers</a></li>
<li><a href="products.php?product_sub_type=Pumps">Pumps</a></li>
<li><a href="products.php?product_type= Tillers - Rotary Hoe">Tillers/Rotary Hoe</a></li>
<li><a href="products.php?product_type=Toro Trax and Mini Diggers">Toro Trax and Mini Diggers</a></li>
</ul>


And you want to list them dynamically -- only listing the sub-categories of a selected category?

To figure this out, we'd need to know how your sections are configured (i.e. their names and their fields' names). We'd also need to know how the relationships between your sections work (I noticed that in your hardcoded list I've duplicated above, you're not using record numbers in the query strings -- this is entirely possible, but can be a little trickier to set up.) Please post your details and I'll take a look.

Alternately, we can quickly get this working for you through our consulting service. Please let me know if you're interested in that.
All the best,
Chris

Re: [chris] Show sub types in navigation with linked lists

OK:

1. we have a product_types section with one field: product_types (text field)

2. we have a product_sub_types section with two fields: product_types (list that looks up product_types) and product_sub_types (text field)

3. We have a products section with the following fields:

product_name
product_type
product_sub_type
brand
description
hidden

product_type is a list field that pulls it values from product_types
product_sub_type is a list field that uses the "get options from MYSQL query (advanced)" option with this query:

SELECT product_sub_types, product_sub_types FROM cms_product_sub_types WHERE product_types = '<?php echo $ESCAPED_FILTER_VALUE ?>'

Now that I've written that all out, to hell with that. Can you guys do it with consulting? Send me the quote and I'll shoot through the access details.

Cheers,

Benedict

Re: [benedict] Show sub types in navigation with linked lists

By Chris - December 8, 2009

Hi benedict,

I've sent you an email.
All the best,
Chris