Hi all, i'm using template "minimal_menu.tpl" (build in cms) to show main menu. Hier is source code of this template menu:
{* CSS classes used in this template:
.currentpage - The active/current page
.bullet_sectionheader - To style section header
hr.separator - To style the ruler for the separator *}
{if $count > 0}
{foreach from=$nodelist item=node}
{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->extra1 == 'restricted' and $ccuser->memberof('pracownicy')) or $node->extra1=='' }
{if $node->current == true}
url}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}
{elseif $node->parent == true && $node->depth == 1 and $node->type != 'sectionheader' and $node->type != 'separator'}
url}" class="activeparent"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}
{elseif $node->type == 'sectionheader'}
{$node->menutext}
{elseif $node->type == 'separator'}
{else}
url}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}
{/if}
{/if} {*zamkniecie instrukcji warunkowej dla pola extra1*}
{/foreach}
{repeat string="" times=$node->depth-1}
{/if}
I didn't change nothing, I added only these lines for hide resctricted page:
{if ($node->extra1 == 'restricted' and $ccuser->memberof('pracownicy')) or $node->extra1=='' }
and {/if} {*zamkniecie instrukcji warunkowej dla pola extra1*}.
On left sidebar (in page template) I call menu template like this:
{menu number_of_levels='3' start_level='2' template='minimal_menu.tpl'}
It work's fine, I see all menu, submenu etc. But when I validate my site I have one error with extra tag . For example it's looks like below:
blablabla1
blablabla2
blablabla3
/* extra added tag in this place */
I thing it's problem with template "minimal_menu.tpl", but I'm not expert in smarty, php etc. and I dont know witch line in source code of template is invalid.
Anyone can help?
Regards,
Marek A.
[Solved] extra </li> in menu
[Solved] extra </li> in menu
Last edited by maranc on Sat Jun 05, 2010 1:33 pm, edited 1 time in total.
Re: extra </li> in menu
You actually went into modules > menu manager > templates folder and changed the minimum template there?...
Re: extra </li> in menu
The default template in rel. 1.7.1 works for me.I thing it's problem with template "minimal_menu.tpl"
Reg. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: extra </li> in menu
No, I made changes directly on FTP (download, manual edit minimal_menu.tpl and upload again to FTP).Dr.CSS wrote: You actually went into modules > menu manager > templates folder and changed the minimum template there?...
Best regrads,
Marek A.
Re: extra </li> in menu
It's working to me too. I see menu, submenu etc. But I dont know, why in code I have always extra tag ?Rolf wrote:The default template in rel. 1.7.1 works for me.I thing it's problem with template "minimal_menu.tpl"
Reg. Rolf
Maybe the problem is in css stylesheet?
Best regards
Marek A.
Re: extra </li> in menu
I thing the problem is with parent in menu marked as "restricted". Unfortunately in main sample I introduced bad code, correctly it's lokks like bellow (I have exactly 5 parent in menu, 5th parent is resctricted):
menu1
menu2
menu3
menu4
/*this is extra tag in page code, when user is not loged - guest see only first 4 parent in menu */
But when user is loged page code looks like this:
menu1
menu2
menu3
menu4
menu5 /* 5th parent restricted is showing when user is loged */
And now everything is ok.
I will try change code in my menu template.
Best regards,
Marek A.
menu1
menu2
menu3
menu4
/*this is extra tag in page code, when user is not loged - guest see only first 4 parent in menu */
But when user is loged page code looks like this:
menu1
menu2
menu3
menu4
menu5 /* 5th parent restricted is showing when user is loged */
And now everything is ok.
I will try change code in my menu template.
Best regards,
Marek A.
Re: extra </li> in menu
OK, now it's working good, I had to change code in template menu. Template source:
{* CSS classes used in this template:
.currentpage - The active/current page
.bullet_sectionheader - To style section header
hr.separator - To style the ruler for the separator *}
{if $count > 0}
{foreach from=$nodelist item=node}
{if ($node->extra1 == 'restricted' and $ccuser->memberof('pracownicy')) or $node->extra1=='' }
{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->current == true}
url}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}
{elseif $node->parent == true && $node->depth == 1 and $node->type != 'sectionheader' and $node->type != 'separator'}
url}" class="activeparent"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}
{elseif $node->type == 'sectionheader'}
{$node->menutext}
{elseif $node->type == 'separator'}
{else}
url}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}
{/if}
{/if} {*zamkniecie instrukcji warunkowej dla pola extra1*}
{/foreach}
{repeat string="" times=$node->depth-1}
{/if}
For me it's working (restricted page are hiden, page is validated without errors). BTW - if someone is expert and can look in template code... Maybe my way isn't corect?
Best regards,
Marek A.
{* CSS classes used in this template:
.currentpage - The active/current page
.bullet_sectionheader - To style section header
hr.separator - To style the ruler for the separator *}
{if $count > 0}
{foreach from=$nodelist item=node}
{if ($node->extra1 == 'restricted' and $ccuser->memberof('pracownicy')) or $node->extra1=='' }
{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->current == true}
url}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}
{elseif $node->parent == true && $node->depth == 1 and $node->type != 'sectionheader' and $node->type != 'separator'}
url}" class="activeparent"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}
{elseif $node->type == 'sectionheader'}
{$node->menutext}
{elseif $node->type == 'separator'}
{else}
url}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}
{/if}
{/if} {*zamkniecie instrukcji warunkowej dla pola extra1*}
{/foreach}
{repeat string="" times=$node->depth-1}
{/if}
For me it's working (restricted page are hiden, page is validated without errors). BTW - if someone is expert and can look in template code... Maybe my way isn't corect?
Best regards,
Marek A.
Re: [Solved] extra </li> in menu
You are most times going to go to admin > layout > menu manager and import a menu template then make changes to it there, naming it and adding your code, not FTP to modules > menu manager > templates folder and changed the minimum template there, meaning just what you did, no real need to change the default templates that way...