[SOLVED] How do I display Image in Products Hierarchy

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
CapereSpiritum
Forum Members
Forum Members
Posts: 223
Joined: Wed Dec 28, 2011 12:11 pm

[SOLVED] How do I display Image in Products Hierarchy

Post by CapereSpiritum »

I'm using Products 2.18.4. I do realise that there is a newer version but...

I need the Attributes function that is not available in the latest version, so...

My Problem...
When I 'Add Hierarchy Item', I specify an image to upload with the 'Image' Choose File function.

How do I get that image to display in the Summary mode?
I cannot see what I need to do in either the Summary or Hierarchy Report templates.
Anyone have experience with this?
Last edited by CapereSpiritum on Thu Aug 29, 2013 5:40 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: How do I display Image in Products Hierarchy

Post by Dr.CSS »

I would put {get_template_vars} in the products template to see what fields are available...
CapereSpiritum
Forum Members
Forum Members
Posts: 223
Joined: Wed Dec 28, 2011 12:11 pm

Re: How do I display Image in Products Hierarchy

Post by CapereSpiritum »

Hi Doc
Did that and got this... Can't see anything that helps tho...
app_name = CMS
cgsimple = Object
ccuser = Object
feu_smarty = Object
sitename = Ticky Turner
content_obj = Object
content_id = 57
page = Shopping
page_id = Shopping
page_name = Shopping
page_alias = Shopping
position = 3
friendly_position = 3
lang = en_US
encoding = utf-8
smarty =
gcb_params = Array (1)
actionid = m55afb
actionparams = Array (3)
returnid = 57
actionmodule = Products
menuparams = Array (4)
count = 5
nodelist = Array (5)
number_of_levels = 10000
node = Object
classes = menuactive
mod = Object
Products = Object
items = Array (1)
totalcount = 1
itemcount = 1
pagetext = Page
oftext = Of
pagecount = 1
curpage = 1
firstlink = <<
prevlink = <
lastlink = >>
nextlink = >
currency_symbol = £
weight_units = lbs
entry = Object
SCRIPT_NAME = /index.php
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: How do I display Image in Products Hierarchy

Post by velden »

Probably it's somewhere in the Products of Items variable.

I often use the {debug} tag inside summary/details templates (though never used products) to see what's in the items. You need to enable popups in your browser.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1978
Joined: Mon Jan 29, 2007 4:47 pm

Re: How do I display Image in Products Hierarchy

Post by Jo Morg »

To get a list of items and probably the fields too try
{$items|@print_r}.

*edited: missed the $... so its $items, not items
Last edited by Jo Morg on Wed Aug 28, 2013 5:26 pm, edited 1 time in total.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: How do I display Image in Products Hierarchy

Post by Dr.CSS »

Now if you do what Jo Morg says you will see what is available in Products items...
CapereSpiritum
Forum Members
Forum Members
Posts: 223
Joined: Wed Dec 28, 2011 12:11 pm

Re: How do I display Image in Products Hierarchy

Post by CapereSpiritum »

Sorted...
Although I suspect there was an easier way, I added a little code after {* IMAGE *}

Code: Select all

{if !isset($hdepth) && isset($hierarchy_item)}
<h3>Hierarchy Data for {$hierarchy_item.name} ({$hierarchy_item.id})</h3>
{/if}

{if !isset($hdepth)}{assign var='hdepth' value='0'}{/if}
<ul class="products_hierarchy_level{$hdepth}">
{foreach from=$hierdata key='key' item='item'}
{strip}
<div id="hierpic">
  <li {if isset($active_hierarchy) and $item.id == $active_hierarchy} {/if}>
<h4><a href="{$item.url}" title="{$item.name}">{$item.name}</a></h4>
{* IMAGE *} <a href="{$item.url}"><img src="uploads/Products/hierarchy/{$item.image}" title="{$item.name}" /></a>
  {if isset($item.children) } {include file=$smarty.template hierdata=$item.children hdepth=$hdepth+1} {/if}
  </li>
</div>
{/strip}
{/foreach}
</ul>
Post Reply

Return to “Modules/Add-Ons”