Coldman wrote:
maranc
Try this:
1) Create a test template.
2) Add your current hierarchy template beetween {else} {/if}
See example down here.
3) Call it with {Products action="hierarchy" useoldhierarchy="1" hierarchytemplate="YOUR TEST TEMPLATE"}
Code: Select all
{* hierarchy report template *}
{if !isset($hdepth)}
<h3>Hierarchy Data for {$hierarchy_item.name} ({$hierarchy_item.id})</h3>
{/if}
{if isset($hierdata)}
{if !isset($hdepth)}{assign var='hdepth' value='0'}{/if}
{*
// create a nested set of unordered lists
// if the active_hierarchy smarty variable exists
// and matches the current hierarchy id
// the active class will be given
// to the ul. You may want to modify your summary template
// to set this variable
*}
{foreach from=$hierdata key='key' item='item'}
{strip}
{if $key == $datakey}
{* it's a node we display it *}
<li {if isset($active_hierarchy) and $item.id == $active_hierarchy} active{/if}>{if $item.count gt 0}<a href="{$item.url}">{$item.name} ({$item.count})</a>{else}{$item.name} ({$item.count}){/if}</li>
{else}
{* it's a child -- call this template again with the node *}
<ul class="products_hierarchy_level{$hdepth}">
{include file=$smarty.template hierdata=$item datakey='node' hdepth=$hdepth+1}
</ul>
{/if}
{/strip}
{/foreach}
{* old hierarchy stuff *}
{else}
[b]Add your current hierarchy template here [/b]
{/if}{* old hierarchy stuff *}
Hi Coldman, yesterday I upgraded module to ver. 2.8.1 and I must tell you, that your template don't work with this version. But hier is one change - default hierarchy template now works fine - but hier is one little bug: default hierarchy template show only parent, when I click on parent I dont see child. The same is with parameter "useoldhierarchy": I see only parent. I thing its a litlle bug in module. I'm not expert in smarty etc. If someone can look in code default hierarchy template and tell what is wrong:
{* hierarchy report template *}
Hierarchy Data for {$hierarchy_item.name} ({$hierarchy_item.id})
{if isset($upurl)}
Lang('parent')}">{$mod->Lang('parent')}
{/if}
{assign var='prodmod' value=$mod}
{if isset($parent)}
This Node
Name: {$parent.name}
Description: {$parent.description}
{/if}
Child Nodes
{if isset($child_nodes) && count($child_nodes)}
{foreach from=$child_nodes item='node'}
{if isset($node.downurl)}
{$node.name}
{else}
{$node.name}
{/if}
{if !empty($node.image)}
{capture assign='image'}{$hierarchy_image_location}/{$node.image}{/capture}
{capture assign='name'}{$node.name}{/capture}
{if !empty($node.thumbnail)}
{capture assign='thumb'}{$hierarchy_image_location}/{$node.thumbnail}{/capture}
{else}
{/if}
{/if}
{if !empty($node.description)}
Description: {$node.description}
{/if}
{/foreach}
{/if}
Products matching this location in hierarchy
{Products hierarchyid=$hierarchy_item.id}
Marek A.