Page 1 of 1

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

Posted: Sat Jul 07, 2012 5:59 pm
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

Re: [confirmed] Menumanger $node->image

Posted: Sat Jul 07, 2012 6:54 pm
by Rolf
confirmed in rev. 8167

Good catch, jce76350!!

Re: [confirmed] Menumanger $node->image

Posted: Sun Jul 08, 2012 5:01 pm
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.

Re: [confirmed] Menumanger $node->image

Posted: Mon Jul 09, 2012 12:04 pm
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