• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How to get the last item in the menu
PostPosted: Thu Jul 16, 2009 8:06 am 
Offline
New Member

Joined: Wed Apr 01, 2009 3:24 pm
Posts: 3
Hello,

I am currently using CMSMS 1.5.1 and I am trying to achieve this navigation

Home | About Us | Contact

Unfortunately, it's always displaying an extra pipe at the end


Home | About Us | Contact |

Is there a way to do this? Like {$node->last_item}?

Thanks in advance!


Top
 Profile  
 
 Post subject: Re: How to get the last item in the menu
PostPosted: Thu Jul 16, 2009 1:42 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 5952
Location: Fernie British Columbia, Canada
Read the smarty manual.

_________________
Follow me on twitter
For quality help follow these instructions:
a) Think about the problem for an hour
b) research the problem for an hour
c) spend 1/2 an hour explaining it and providing as much information as you can muster
(too much information is okay, not enough information may get your question ignored).
--
if you can't bother explaining your problem well, why should we bother helping with it.
----------------
Don't make me angry..... you won't like me when I'm angry....


Top
 Profile  
 
 Post subject: Re: How to get the last item in the menu
PostPosted: Thu Jul 16, 2009 2:31 pm 
Offline
Power Poster
Power Poster

Joined: Mon Jan 21, 2008 5:51 pm
Posts: 702
Location: MI
How about just searching the forum. I have seen this request posted and answer multiple times within the last couple days.

_________________
Arvixe Hosting / CMSMS Community Liaison
Looking for quality CMSMS Hosting? Try Arvixe


Top
 Profile  
 
 Post subject: Re: How to get the last item in the menu
PostPosted: Fri Jul 17, 2009 4:20 am 
Offline
New Member

Joined: Wed Apr 01, 2009 3:24 pm
Posts: 3
I am not really sure what keyword to use to search this. The admin could put it in as a sticky if you have seen it asked a couple of times.


Top
 Profile  
 
 Post subject: Re: How to get the last item in the menu
PostPosted: Fri Jul 17, 2009 5:00 am 
Offline
New Member

Joined: Wed Apr 01, 2009 3:24 pm
Posts: 3
I read the smarty manual and got it to work. Here is the code

Code:
{* CSS classes used in this template:
#menuwrapper - The id for the <div> that the menu is wrapped in. Sets the width, background etc. for the menu.
#primary-nav - The id for the <ul>
.menuparent - The class for each <li> that has children.
.menuactive - The class for each <li> that is active or is a parent (on any level) of a child that is active. *}
{if $count > 0}
<div id="menuwrapper">
<ul id="primary-nav">
{foreach from=$nodelist item=node name=foo}
{if $node->depth > $node->prevdepth}
{repeat string="<ul class='unli'>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
<li class="menuactive menuparent">
<a class="menuactive menuparent" {elseif $node->current == true}
<li class="menuactive">
<a class="menuactive" {elseif $node->haschildren == true}
<li class="menuparent">
<a class="menuparent" {elseif $node->type == 'sectionheader'}
<li class="sectionheader"><span>{$node->menutext}</span> {elseif $node->type == 'separator'}
<li style="list-style-type: none;"> <hr class="separator" />{else}
<li>
<a {/if}

{if $node->type != 'sectionheader' and $node->type != 'separator'}
href="{$node->url}"><span>{$node->menutext}</span></a>
{if $smarty.foreach.foo.last == 0} |
{/if}
{elseif $node->type == 'sectionheader'}
><span>{$node->menutext}</span></a>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}
</li>
</ul>
<div class="clearb"></div>
</div>
{/if}


Do you think there could be a better solution to this?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner