[Solved] [confirmed] Menumanger $node->image

Post Reply
jce76350
Beta Tester
Beta Tester
Posts: 1950
Joined: Mon May 29, 2006 1:20 pm
Location: Rouen

[Solved] [confirmed] Menumanger $node->image

Post by jce76350 »

Hi,

using the accessible_simple_navigation.tpl on Left simple navigation + 1 column
{menu template='accessible_simple_navigation.tpl' collapse='1'}

accessible_simple_navigation.tpl on line 36 I have add

Code: Select all

{if $node->image != ''}&nbsp;&nbsp;<img src="{$node->image}" alt="" />{/if}
at the end

so the line is

Code: Select all

<li><a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}><dfn>{$node->hierarchy}:</dfn><span>{$node->menutext}</span>{if $node->image != ''}&nbsp;&nbsp;<img src="{$node->image}" alt="" />{/if}</a>
into the page default_templates add an image in tag Options /Image

On the web page No image into the menu But
Notice: Undefined property: stdClass::$image in \tmp\templates_c\b8312...c7838.module_file_tpl.MenuManager;accessible_simple_navigation.tpl.php on line 87

Code: Select all

line 87 : </span><?php if ($_smarty_tpl->tpl_vars['node']->value->image!=''){?>&nbsp;&nbsp;<img src="<?php echo $_smarty_tpl->tpl_vars['node']->value->image;?>
same test on version 1.10.3 no error message and the image is correct into the menu
Last edited by jce76350 on Mon Jul 09, 2012 12:05 pm, edited 1 time in total.
Jean-Claude Etiemble
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7749
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: [confirmed] Menumanger $node->image

Post by Rolf »

confirmed in rev. 8167

Good catch, jce76350!!
Image
- + - + - + - + - + -
Latest CMSMS tutorial: FormBuilder WatchGuard
- + - + - + - + - + -
Did my post help you solving a problem at your (customers) website and it saved you many hours of work?
Great!! Buy me a cup of coffee in return as a small token of appreciation!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: [confirmed] Menumanger $node->image

Post by calguy1000 »

Note, the expression should be: {if isset($node->image) && $node->image != ''}...{/if}
because the $node->image is only set for the appropriate content pages.

Secondly, I think the issue with the image not being displayed is because of where you stuck the expression.... its the 'catch all' expression for nodes that don't have children, aren't separators or section headers, and aren't the active page.
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.
jce76350
Beta Tester
Beta Tester
Posts: 1950
Joined: Mon May 29, 2006 1:20 pm
Location: Rouen

Re: [confirmed] Menumanger $node->image

Post by jce76350 »

Hi,
Note, the expression should be: {if isset($node->image) && $node->image != ''}...{/if}
because the $node->image is only set for the appropriate content pages.
Ok Thanks that's solved the problem no error and image is displayed
Jean-Claude Etiemble
Post Reply

Return to “Closed Issues”