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)
-   -   Show only sub-categories in left sidebar? (https://forum.x-cart.com/showthread.php?t=59562)

hollaratbear 05-29-2011 06:16 PM

Show only sub-categories in left sidebar?
 
I'm desiging a store with a horizontal menu for my root categories. Once one is clicked, I'd like to display only the corresonding sub-categories in the left sidebar. Anyone got a simple way of accomplishing this?

hollaratbear 05-29-2011 08:32 PM

Re: Show only sub-categories in left sidebar?
 
New problem. Nevermind the previous...changed categories.tpl to this

Code:

{*
$Id: categories.tpl,v 1.33 2008/11/06 16:53:53 max Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
{capture name=menu}
{if $active_modules.Fancy_Categories}
  {include file="modules/Fancy_Categories/categories.tpl"}
  {assign var="additional_class" value="menu-fancy-categories-list"}
{else}
  <ul>
    {foreach from=$subcategories item=subcat}
          <li>
            <a href="home.php?cat={$subcat.categoryid}">{$subcat.category|escape}</a>
{/foreach}
  </ul>
  {assign var="additional_class" value="menu-categories-list"}
{/if}
{/capture}
{include file="customer/menu_dialog.tpl" title=$lng.aisles content=$smarty.capture.menu}


Now the problem is that when I click a menu item that has no sub-categories, my menu disappears. I guess what I'm looking for is a statement that says "if there are no subcategories, show all subcategories of this subcategory's parent. Does that make sense? If I click a 2nd level that has only products and no 3rd level categories, I only want to display the other 2nd level categories of the parent in categories.tpl. Can anyone help?

hollaratbear 06-16-2011 06:42 PM

Re: Show only sub-categories in left sidebar?
 
For anyone looking for something similar....horizontal category bar with only the current subcats for each in a sidebar..check this post - http://forum.x-cart.com/showthread.php?t=58751


All times are GMT -8. The time now is 10:40 PM.

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