Products: Hierarchy Report Template

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
makhatri
Forum Members
Forum Members
Posts: 31
Joined: Sun Jul 14, 2013 11:02 am

Products: Hierarchy Report Template

Post 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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Products: Hierarchy Report Template

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
makhatri
Forum Members
Forum Members
Posts: 31
Joined: Sun Jul 14, 2013 11:02 am

Re: Products: Hierarchy Report Template

Post 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
makhatri
Forum Members
Forum Members
Posts: 31
Joined: Sun Jul 14, 2013 11:02 am

Re: Products: Hierarchy Report Template

Post 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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Products: Hierarchy Report Template

Post by calguy1000 »

The module help clearly describes the hierarchytemplate parameter.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
makhatri
Forum Members
Forum Members
Posts: 31
Joined: Sun Jul 14, 2013 11:02 am

Re: Products: Hierarchy Report Template

Post 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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Products: Hierarchy Report Template

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
makhatri
Forum Members
Forum Members
Posts: 31
Joined: Sun Jul 14, 2013 11:02 am

Re: Products: Hierarchy Report Template

Post 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:

Code: Select all

{Products action=hierarchy} 
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:

Code: Select all

Knitted Bed Sheets (2)
Towels (1)
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
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Products: Hierarchy Report Template

Post 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
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
makhatri
Forum Members
Forum Members
Posts: 31
Joined: Sun Jul 14, 2013 11:02 am

Re: Products: Hierarchy Report Template

Post by makhatri »

Thanks Rolf for the link.

Any idea about my last message?

-MAK
Post Reply

Return to “The Lounge”