Page 1 of 1

SOLVED: MenuManager

Posted: Fri Oct 09, 2009 8:55 am
by robinmarek
CMS version 1.6.6

I've just transfered a site from one server to another (on the same type of hosting) and am using the section expand template for the Menu.

Now occasionally it gives this error, which goes away if I refresh the page. The menu stays there but it is pushed down by the error. It doesn't do it on the old site so can only assume something has gone strange in the transfer. Any ideas?
string(144) "Smarty error: [in module_db_tpl:MenuManager;sectionexpand line 16]: syntax error: unrecognized tag 'while' (Smarty_Compiler.class.php, line 590)" string(145) "Smarty error: [in module_db_tpl:MenuManager;sectionexpand line 20]: syntax error: unrecognized tag '/while' (Smarty_Compiler.class.php, line 590)" string(144) "Smarty error: [in module_db_tpl:MenuManager;sectionexpand line 57]: syntax error: unrecognized tag 'while' (Smarty_Compiler.class.php, line 590)" string(145) "Smarty error: [in module_db_tpl:MenuManager;sectionexpand line 61]: syntax error: unrecognized tag '/while' (Smarty_Compiler.class.php, line 590)"
This is the sectionexpand template:
{* 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}

Re: MenuManager

Posted: Fri Oct 09, 2009 2:48 pm
by calguy1000
Where did you get this menu template from, it's not one of ours...
smarty doesn't have a {while} plugin so you must've downloaded one from somewhere, or this menu template never worked properly.

Re: MenuManager

Posted: Fri Oct 09, 2009 6:07 pm
by robinmarek
You know it's weird I really can't remember where I got it from, I did it ages ago... I'll have to google and find out, but it actually did work on the other website it's just decided not to now.

Will let you know!

Re: MenuManager

Posted: Fri Oct 09, 2009 6:09 pm
by robinmarek
Actually I just found it - it was on the Wiki for CMS Made Simple:

http://wiki.cmsmadesimple.org/index.php ... ion_expand

Re: MenuManager

Posted: Fri Oct 09, 2009 6:13 pm
by robinmarek
And I actually just answered my own question... it's because I needed to create the compiler.while.php file and put it in the lib/smarty/pugin folder

Thanks calguy... I thought it was already a plugin with CMSMS I completely forgot I had to do all that!!