Page 1 of 1

[SOLVED] I don't want to display empty menu if current language is not ready!

Posted: Sun Nov 25, 2007 12:38 am
by percusionista
Hi Alby

I´ve read your post explaining how to do it in a simple template

http://forum.cmsmadesimple.org/index.php/topic,15318.msg81169.html#msg81169

but when I try to do it in css menu template I have changed in this way (red color my insert) iy gives me a warnig error insted than menu:
{* CSS classes used in this template:
#menuwrapper - The id for the that the menu is wrapped in. Sets the width, background etc. for the menu.
#primary-nav - The id for the
.menuparent - The class for each that has children.
.menuactive - The class for each that is active or is a parent (on any level) of a child that is active. *}
{if $count > 0}


{foreach from=$nodelist item=node}

{if !empty($node->menutext)} {* for not showing menu in language if empty*}

{if $node->depth > $node->prevdepth}

{repeat string="" times=$node->depth-$node->prevdepth}
{elseif $node->depth prevdepth}

{repeat string="" times=$node->prevdepth-$node->depth}

{elseif $node->index > 0}
{/if}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
current == true}
haschildren == true}
type == 'sectionheader'}
        {$node->menutext}
{elseif $node->type == 'separator'}
       
{else}
type != 'sectionheader' and $node->type != 'separator'}
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 ne ""} target="{$node->target}"{/if}>{$node->hierarchy}: {$node->menutext}
{elseif $node->type == 'sectionheader'}
>{$node->hierarchy}: {$node->menutext}
{/if}
{/if}  {* this is my other tag insert *}
{/foreach}

{repeat string="" times=$node->depth-1}



{/if}
What is wrong in it and how should it be right

thanks

Re: inML I don't want to display empty menu items if current language is not rea

Posted: Sun Nov 25, 2007 8:44 am
by alby
percusionista wrote: but when I try to do it in css menu template I have changed in this way (red color my insert) iy gives me a warnig error insted than menu:
..............
What is error text?

Alby

Re: inML I don't want to display empty menu items if current language is not rea

Posted: Sun Nov 25, 2007 5:38 pm
by percusionista
this is the error message instead that menu in page:
string(83) "Smarty error: unable to read resource: "module_file_tpl:MenuManager;CSSml_menu.tpl""

this is the way I insert in page template:
      {* Start Navigation *}

     

        Navigation

        {menu template='CSSml_menu.tpl'}

     

     

      {* End Navigation *}
Of course I have saved the menu template, and appear in Menu Manager module in Database Templates,  as :      CSSml_menu

Re: inML I don't want to display empty menu items if current language is not rea

Posted: Sun Nov 25, 2007 8:13 pm
by alby
percusionista wrote: this is the error message instead that menu in page:
string(83) "Smarty error: unable to read resource: "module_file_tpl:MenuManager;CSSml_menu.tpl""
If you have the name CSSml_menu, you MUST call module with {menu template="CSSml_menu"} and not {menu template="CSSml_menu.tpl"}

Alby

inML I don't want to display empty menu items if current language is not rea

Posted: Sun Nov 25, 2007 10:37 pm
by percusionista
O.K. Solved

Works great

thank you