Page 1 of 1

Menu Manager Smarty Error

Posted: Wed Sep 12, 2007 1:54 pm
by Kristy
Hi I am using v 1.1.2 My site is almost complete and everthing has worked great. I seem to be getting a sporadic smarty error when I switch between pages. It doesn't happen all of the time and all I have to do is re load the page and the error goes away.

Can anyone help me with the error below?

Code: Select all

string(145) "Smarty error: [in module_db_tpl:MenuManager;section_expand line 17]: syntax error: unrecognized tag 'while' (Smarty_Compiler.class.php, line 590)" string(146) "Smarty error: [in module_db_tpl:MenuManager;section_expand line 21]: syntax error: unrecognized tag '/while' (Smarty_Compiler.class.php, line 590)" string(145) "Smarty error: [in module_db_tpl:MenuManager;section_expand line 49]: syntax error: unrecognized tag 'while' (Smarty_Compiler.class.php, line 590)" string(146) "Smarty error: [in module_db_tpl:MenuManager;section_expand line 53]: syntax error: unrecognized tag '/while' (Smarty_Compiler.class.php, line 590)" 
The site is http://rambouilletsheep.org

Any advice or help would be appreciated!

Thanks

Re: Menu Manager Smarty Error

Posted: Wed Sep 12, 2007 2:49 pm
by cyberman
Can you post your menu template?

Re: Menu Manager Smarty Error

Posted: Wed Sep 12, 2007 3:33 pm
by Kristy
I sure can...

{* CSS classes used in this template:
#active - The active/current page
li#separator - To style the ruler for the separator
span.sectionheader - To style section header *}
{if $count > 0}



{assign var="prevdepth" value="1"}
{foreach from=$nodelist item=node}
{assign var="prevdepth" value=$prevnode->depth}
{if ($node->depth haschildren == "1")} {* bugfix if subitems were not shown in menu *}
{else}
{if $node->depth depth}
{while (($act_depth > 0) and ($collapseopened > 0))}

{assign var="act_depth" value=$act_depth-1}
{assign var="collapseopened" value=$collapseopened-1}
{/while}
{else}

{/if}
{/if}
{/if}

{if $node->type == 'separator'}

{else}
{if $node->current == true}
{else}
{/if}
id}" {if $node->type != 'sectionheader'}href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}{/if}{if $node->haschildren == '1'}
{assign var="collapseopened" value=$collapseopened+1} onclick="expandcontent('sub{$node->id}')"{else}{/if} style="cursor:hand; cursor:pointer">
{if $node->type == 'sectionheader'}{/if}
{$node->menutext}
{if $node->type == 'sectionheader'}{/if}

{if $node->haschildren == '1'}id}" class="expand">{/if}
{/if}
{assign var="prevnode" value=$node}
{/foreach}

{if ($prevnode->haschildren == "1")} {* bugfix if subitems were not shown in menu *}
{else}
{if $prevnode->depth > 1}
{assign var="act_depth" value=$prevnode->depth-1}
{while (($act_depth > 0) and ($collapseopened > 0))}

{assign var="act_depth" value=$act_depth-1}
{assign var="collapseopened" value=$collapseopened-1}
{/while}
{else}

{/if}
{/if}



{/if}


Thanks,

Re: Menu Manager Smarty Error

Posted: Wed Sep 12, 2007 6:58 pm
by Dr.CSS
The 'while'  '/while' lines are not in your menu template so they must be coming from the the JS, maybe the smarty calls need to be updated in it...

Re: Menu Manager Smarty Error

Posted: Wed Sep 12, 2007 7:38 pm
by Kristy
Thanks for looking!

Ok I'll bite...  How do I update the smarty calls?


Thanks!

Re: Menu Manager Smarty Error

Posted: Wed Sep 12, 2007 8:28 pm
by Dr.CSS
I can't get it to do the error, any reason you are using the expanding menu, in IE6 it stays expanded when clicking thru the page anchor links but in Firefox they collapse and changing pages make them open then close...

You could use another menu template and use the collapse='1' in the menu tag to get it to only show relevant pages below...

Like home page of default install...

Re: Menu Manager Smarty Error

Posted: Wed Sep 12, 2007 9:31 pm
by Kristy
Thanks for the info. I hadn't checked the menu in other browsers yet. Thank you for doing that. I'll try another menu and see how that works.

Thank you very much for your time.

Re: Menu Manager Smarty Error

Posted: Thu Sep 13, 2007 2:31 pm
by cyberman
mark wrote: The 'while'  '/while' lines are not in your menu template
Smarty has not a while construct and you have to write Smarty inside MenuManager template.