Wallpaper Script Forum » How-To and Troubleshooting

Displaying only Parent Categories

(7 posts)
  • Started 3 years ago by KWilfred
  • Latest reply from KWilfred
  1. Hi,

    Anyone knows a quick hack to display only Parent Categories on the Category Block? Sub-categories will show once a parent category is clicked - I would prefer the sub-categories to be hidden. I tried looking at the categoriesblock.tpl file, but have no clue where to make the edit in the file.

    Thanks for the help :)

    Posted 3 years ago #
  2. remotay
    Member

    Can anyone please answer this? I need help with this same thing!!

    Posted 3 years ago #
  3. Where do you want not to see subcategories exactly? In right menu categories listing or on other section?

    Posted 3 years ago #
  4. Yes, in the right menu categories listing. I don't mind them showing on other sections.

    Posted 3 years ago #
  5. {if $flattenCategories|@count >0}<div class="side-header">{l s='categories' mod='categoriesblock'}</div>
    <ul class="side-panel categories">{section name=item loop=$flattenCategories}{if $flattenCategories[item].item.num_items > 0 and $flattenCategories[item].item.enabled==1 and $flattenCategories[item].indent == 0}<li style="padding-left:{math equation="x*5" x=$flattenCategories[item].indent}px;">{$flattenCategories[item].item.name} <small>({$flattenCategories[item].item.num_items})</small>{/if}{/section}{/if}

    Posted 3 years ago #
  6. Copy the code from the txt file as pasting the code in the forum formats it as html.

    Attachments

    1. categoriesblock.txt (0.7 KB, 47 downloads) 3 years old
    Posted 3 years ago #
  7. Thank you very much for this!
    It works wonderfully :)

    Posted 3 years ago #

RSS feed for this topic

Reply

You must log in to post.