Page 1 of 1

[solved] Products - list products with categories as headings?

Posted: Sun Sep 12, 2010 3:30 pm
by mrchristoph
Hi all,

I have the 'products' module which seems to be what I need.

I thought one of the default templates would simply be a list of the products, with the categories as headings - each listed product links to a detail page, but none of the templates seem to do this. Can anyone give me an idea how to amend the template for this, I'm sure its really simple!

Do I need to use the hierarchy?

Please help!

Thanks

Re: Products - list products with categories as headings?

Posted: Tue Sep 14, 2010 6:19 pm
by mrchristoph
*whistle...  :-[

Re: Products - list products with categories as headings?

Posted: Tue Sep 14, 2010 7:11 pm
by mrchristoph
If anyone at all is interested I seem to have reached a solution, but I'm suprised it worked, and I'm happy for other suggestions. In the hierarchy template I've called the Products module within it using the the summary template, using $item.name as the variable for hierarchy item:

Code: Select all

{foreach from=$hierdata key='key' item='item'}
{strip}
  <li {if isset($active_hierarchy) and $item.id == $active_hierarchy} class="active"{/if}>
  {if $item.count gt 0}
     <a href="{$item.url}">{$item.name} ({$item.count})</a>
  {else}
     {$item.name} ({$item.count})
  {/if}
  {/strip}
{Products action="default" hierarchy=$item.name summarytemplate="cake-summ"}
  </li>

{/foreach}
Thanks yet again for all your invaluable advice - I couldn't have done it without you  ::)