[Solved] extra </li> in menu

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

[Solved] extra </li> in menu

Post by maranc »

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.
Last edited by maranc on Sat Jun 05, 2010 1:33 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: extra </li> in menu

Post by Dr.CSS »

You actually went into modules > menu manager > templates folder and changed the minimum template there?...
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: extra </li> in menu

Post by Rolf »

I thing it's problem with template "minimal_menu.tpl"
The default template in rel. 1.7.1 works for me.

Reg. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: extra </li> in menu

Post by maranc »

Dr.CSS wrote: You actually went into modules > menu manager > templates folder and changed the minimum template there?...
No, I made changes directly on FTP (download, manual edit minimal_menu.tpl and upload again to FTP).

Best regrads,
Marek A.
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: extra </li> in menu

Post by maranc »

Rolf wrote:
I thing it's problem with template "minimal_menu.tpl"
The default template in rel. 1.7.1 works for me.

Reg. Rolf
It's working to me too. I see menu, submenu etc. But I dont know, why in code I have always extra tag ?
Maybe the problem is in css stylesheet?

Best regards
Marek A.
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: extra </li> in menu

Post by maranc »

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.
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: extra </li> in menu

Post by maranc »

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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: [Solved] extra </li> in menu

Post by Dr.CSS »

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...
Post Reply

Return to “Layout and Design (CSS & HTML)”