Page 1 of 1
ListIt2Extended - List Sub Categories In Summary Template
Posted: Tue Jan 07, 2014 4:05 am
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!
Re: ListIt2Extended - List Sub Categories In Summary Templat
Posted: Tue Jan 07, 2014 9:36 am
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.
Re: ListIt2Extended - List Sub Categories In Summary Templat
Posted: Tue Jan 07, 2014 5:31 pm
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.