CMS Made Simple Forums
https://forum.cmsmadesimple.org/

[Solved] [confirmed] Menumanger $node->image
https://forum.cmsmadesimple.org/viewtopic.php?f=80&t=61872
Page 1 of 1

Author:  jce76350 [ Sat Jul 07, 2012 5:59 pm ]
Post subject:  [Solved] [confirmed] Menumanger $node->image

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
\$1:
{if $node->image != ''}&nbsp;&nbsp;<img src="{$node->image}" alt="" />{/if}
at the end

so the line is
\$1:
<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
\$1:
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

Author:  Rolf [ Sat Jul 07, 2012 6:54 pm ]
Post subject:  Re: [confirmed] Menumanger $node->image

confirmed in rev. 8167

Good catch, jce76350!!

Author:  calguy1000 [ Sun Jul 08, 2012 5:01 pm ]
Post subject:  Re: [confirmed] Menumanger $node->image

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.

Author:  jce76350 [ Mon Jul 09, 2012 12:04 pm ]
Post subject:  Re: [confirmed] Menumanger $node->image

Hi,
\$1:
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

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/