ListIt2Extended - List Sub Categories In Summary Template

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
ptysell
Forum Members
Forum Members
Posts: 33
Joined: Tue Oct 10, 2006 1:16 am

ListIt2Extended - List Sub Categories In Summary Template

Post by ptysell »

How would one go about listing sub categories (within a category) while listing list times on the same summary template?

Essentially what I need is an output of the sub categories to generate a filter and then generate all of the items with in the category (and subcategories) to generate the original list to be filtered.

Thanks!
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: ListIt2Extended - List Sub Categories In Summary Templat

Post by velden »

You might consider using a category action/template and use show_items parameter. Then loop the $categories twice; once to list the categories, once to list the items. Iirc you can determine the type by checking for existence of fielddefs property (only items have it).

Code: Select all

<!-- categories -->
<ul>
{foreach from=$categories item=category}
{if !$category->fielddefs}<li class="category-{$category->alias}">{$category->name}</li>{/if}
{/foreach}
<ul>
<!-- categories //-->

<!-- items -->
<ul>
{foreach from=$categories item=category}
{if $category->fielddefs}<li class="category-{$category->alias}">{$category->title}</li><!--{$category|print_r}-->{/if}
{/foreach}
<ul>
<!-- items //-->
However items will be sorted based on category.
ptysell
Forum Members
Forum Members
Posts: 33
Joined: Tue Oct 10, 2006 1:16 am

Re: ListIt2Extended - List Sub Categories In Summary Templat

Post by ptysell »

Thanks.

What I am attempting to do is the following.

Have a page that lists top level categories - Category Template - Done.

Have the next page - Summary Template - List items within that category. - Done.

I am handling the filtering/sorting with jQuery RE sub categories.
This works fine using a fixed list of filter categories (sub categories) for one main category.

This is essentially what I want to setup / output.

Setup
Category 1
-Sub Category A
--Product 1
--Product 2
--Product 3
-Sub Category B
--Product 4
--Product 5
--Product 6
Category 2
-Sub Category C
--Product 7
--Product 8
--Product 9
-Sub Category D
--Product 10
--Product 11
--Product 12

Output Page 1 - Category Page - Category Template (easy)

Category 1
Category 2

Output Page 2 - List Page - Summary Template (Click On Category 1)

Sub Category A | Sub Category B

Product 1
Product 2
Product 3
Product 4
Product 5
Product 6

This something along the lines of this
http://demo.i-arts.eu/list-it-extended

where I want the filter buttons to be dynamically generated on the summary template based on a list of sub categories for that category.
Post Reply

Return to “Modules/Add-Ons”