Page 1 of 1
Products: Hierarchy Report Template
Posted: Sun Sep 29, 2013 2:59 pm
by makhatri
Hi,
I am using Products module 2.19.6. I create multiple item in "Item Hierarchy" with images.
In my Layout --> templates, I add {Products action="hierarchy"}
tag which display all the items perfectly.
1) How can I display only top level items (skip all the children)
2) How can I display picture with every item
Thanks in advance
MAK
Re: Products: Hierarchy Report Template
Posted: Sun Sep 29, 2013 3:29 pm
by calguy1000
See the Hierarchy Report Template in the Products module admin.
The default clearly explains where the child hierarchies are inserted into the template.
For the image, you can use <pre>{$item|@print_r}</pre> to see the fields that are available in the item... and {get_template_vars} to display the other variables that are available for use.
Re: Products: Hierarchy Report Template
Posted: Sun Sep 29, 2013 6:56 pm
by makhatri
Thanks for your quick reply.
I add this code in Hierarchy Report Templates to display image:
Code: Select all
<a href="{$item.url}">
<img src="{root_url}/uploads/Products/hierarchy/{$item.thumbnail}" alt="{$item.name}"/>
{$item.name} ({$item.count}) </a>
One more thing, I have another detail page for display all the subcategories and their products.
When user click on the category image which are at home page, what/How values I will pass to my detail page, so that selected category will active on that page.
Code: Select all
<a href="{cms_selflink href="cat-detail"} &{$item.id}">
....</a>
[/b]
Thanks again for your valuable time.
-MAK
Re: Products: Hierarchy Report Template
Posted: Mon Sep 30, 2013 4:33 pm
by makhatri
Can anybody explain me Product Module, how it's template are interlink with each other?
Is that possible to create multiple Hierarchy template in Product module? And can we use these templates in different content pages except default one.
something like this:
{Products action=hierarchy template=.....}
-MAK
Re: Products: Hierarchy Report Template
Posted: Mon Sep 30, 2013 4:54 pm
by calguy1000
The module help clearly describes the hierarchytemplate parameter.
Re: Products: Hierarchy Report Template
Posted: Tue Oct 01, 2013 12:01 pm
by makhatri
What does
hierarchypage parameter do? I received below message in front of this parameter in help:
Code: Select all
"" - -- Missing Languagestring - module:Products string:param_hierarchypage--
-MAK
Re: Products: Hierarchy Report Template
Posted: Tue Oct 01, 2013 2:22 pm
by calguy1000
The hierarchypage parameter is simmilar to the summarypage and detailpage parameters.
It allows you to use a different page for the down links on a hierarchy report.
Re: Products: Hierarchy Report Template
Posted: Wed Oct 02, 2013 7:30 am
by makhatri
I spend more then 3 days on Product Module, but unfortunately I am not able to achieved what I try to do.
I know the task is not complex, I try different ways but the result is not desirable.
For display my top level Hierarchy I create new template in Hierarchy Report Templates and exclude below code and set it as default:
Code: Select all
{if isset($item.children) }
{* there are children call this template again *}
{include file=$smarty.template hierdata=$item.children hdepth=$hdepth+1}
{/if}
Then I add add Home page in Content --> Pages and add this code:
So far so good, it displays all the top level Hierarchy:
Code: Select all
HOME TEXTILES (3)
KITCHEN ITEMS (1)
When I click on Home Textile, system show me below list on same Home page:
To display the above result in Detail page, I replace the function in Home page:
Code: Select all
{Products action=hierarchy summarypage="detail"}
with this
{Products action=hierarchy}
the above code does not work, system shows the result on Home page instead of Detail page.
I try many functions on Detail page, but I am not clear what should I write (function) on Detail page?
Other then Hierarchy template all other templates are default one
if you think my approach is in wrong direction please correct me, and please let me know what I am missing.
-MAK
Re: Products: Hierarchy Report Template
Posted: Wed Oct 02, 2013 10:35 am
by Rolf
makhatri wrote:What does
hierarchypage parameter do? I received below message in front of this parameter in help:
Code: Select all
"" - -- Missing Languagestring - module:Products string:param_hierarchypage--
-MAK
http://docs.cmsmadesimple.org/troublesh ... uagestring
Re: Products: Hierarchy Report Template
Posted: Wed Oct 02, 2013 10:53 am
by makhatri
Thanks Rolf for the link.
Any idea about my last message?
-MAK