X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   category menu syntax (https://forum.x-cart.com/showthread.php?t=42632)

techspaces 09-27-2008 09:14 AM

category menu syntax
 
I'm creating custom menus for landing pages and I need the categories menu to only parse a specific subcategory. What I don't know is how to alter the syntax to limit to a specific category id. Here's the code I've got so far.

Code:

            <ul class="categoryitems">
                {foreach from=$c.subcats item=sc name=cm2}
                    {if $sc.subcats eq ""}
                        <li><a href="home.php?cat={$sc.categoryid}">{$sc.category}</a></li>
                    {else}
                        <li><a href="#" class="subexpandable">{$sc.category}</a>
                            <ul class="subcategoryitems" style="margin-left: 15px">
                            {foreach from=$sc.subcats item=ssc name=ssc name=cm3}
                                <li><a href="home.php?cat={$ssc.categoryid}">{$ssc.category}</a></li>
                            {/foreach}
                            </ul>
                        </li>
                    {/if}
                {/foreach}
            </ul>


techspaces 09-28-2008 10:06 AM

Re: category menu syntax
 
Bumping and clarifying. In the code above I'm looking for how to format
{foreach from=$c.subcats item=sc name=cm2}
{if $sc.subcats eq ""}
so it will only pull from a specific category number and it's subcategories instead of all categories.


All times are GMT -8. The time now is 03:27 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.