I have made a 2-level catalog module using CTLModuleMaker version 1.8.9.3. I´m using CMS Made Simple 1.8.2.
I´ve got a 3-column layout; leftCol, mainCol and a rightCol. I´m trying to accomplish a vertical menu in the left column that acts as a ordinary menu in CMSMS, and at the same time have another module template in the main column that shows the elements with some more information. Attaching an image to make things clearer:
(It´s in swedish)In category list view, it shows the categories. In product list view it highlights the category in the menu and folds out the children elements. And in detail view, it highlights the selected element.
I call the module using:
Code: Select all
{cms_module module="varahus" what="kategori"}This is placed in the {content} of the template.
This is how my module templates looks like.
list_category:
Code: Select all
{* Breadcrum and searchbar *}
<div id="breadcrumSearch">
<div id="search">
{search}
</div>
<div id="breadcrum">
<b>Du är här: </b>{varahus_breadcrumbs root="Hem" delimiter=" / "}
</div>
</div>
{* End Breadcrum and searchbar *}
{* Left column *}
<div id="leftCol">
<div id="menu_vert">
{if $itemcount > 0}
<ul>
{foreach from=$itemlist item="item"}
<li><a href="{$item->detailurl}"><span>» {$item->name}</span></a></li>
{/foreach}
</ul>
{/if}
</div>
</div>
{* End Left column *}
{* Start main content *}
<div id="middleContent">
<div id="houseCatalog" class="clearfix">
<h1>{title}</h1>
{if $itemcount > 0}
<ul>
{foreach from=$itemlist item="item"}
<li class="{cycle values="category,category last"}">
<a href="{$item->detailurl}"><img src="{$item->cat_image->url}" /></a>
<h3>{$item->detaillink}</h3>
<p>{$item->description}</p>
</li>
{/foreach}
</ul>
{/if}
</div>
</div>
{* End main content *}
Code: Select all
{* Breadcrum and searchbar *}
<div id="breadcrumSearch">
<div id="search">
{search}
</div>
<div id="breadcrum">
<b>Du är här: </b>{varahus_breadcrumbs root="Hem" delimiter=" / "}
</div>
</div>
{* End Breadcrum and searchbar *}
{* Left column *}
<div id="leftCol">
<div id="menu_vert">
{if $itemcount > 0}
<ul>
{foreach from=$itemlist item="item"}
<li><a href="{$item->detailurl}"><span>» {$item->name}</span></a></li>
{/foreach}
</ul>
{/if}
</div>
</div>
{* End Left column *}
{* Start main content *}
<div id="middleContent">
<div id="houseCatalog" class="clearfix">
<h1>{title}</h1>
{if $itemcount > 0}
<ul>
{foreach from=$itemlist item="item"}
<li class="{cycle values="category,category last"}">
<a href="{$item->detailurl}"><img src="{$item->prod_image->url}" /></a>
<h3>{$item->detaillink}</h3>
<p>{$item->description}</p>
</li>
{/foreach}
</ul>
{/if}
</div>
{* get_template_vars *}
</div>
{* End main content *}
When I select a category and gets to product list, the left column menu only displays the child elements in the parent. This is where I want all of the level-1 parent elements to display, and the child elements to be shown under associated parent.
I couldn´t find a way to "reach" the level-1 items from the product list template. I´ve tried with different template setups and mockups, but at this point I´m stuck.
I´ve read the FAQ and the help section, searched the forums for any hints but so far only come up with a solution from the FAQ that displays all the elements sorted by parent. This works but the list gets very long.
I hope that I explained the problem well and attached the necessery information to get help, or get pointed in the right direction.
Thanks... (if you read this long)

