• 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  [ 8 posts ] 
Author Message
 Post subject: [solved] how to create a menu without a list?
PostPosted: Wed Aug 05, 2009 12:36 am 
Offline
Forum Members
Forum Members

Joined: Wed Aug 05, 2009 12:27 am
Posts: 16
I'd like to make a menu for a simple site without subpages at the moment; what I want to have is just a line of items separated by a character, like so:

home | photos | bio

Is this possible and if so, how?


Last edited by ntmr on Sun Aug 23, 2009 12:11 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: how to create a menu without a list?
PostPosted: Wed Aug 05, 2009 3:44 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Sat Mar 24, 2007 8:28 am
Posts: 385
Location: Long Beach, CA
Have you tried the basic menu that comes with CMS?

If you don't need sub pages it doesn't matter because if you don't create child pages they won't show under any menu.

The great thing about Menu Manager is that it changes if you change names of pages, and so on, with out having to do it manually, which is one of the reasons why you have a content manager, isn't it  ???


Top
 Profile  
 
 Post subject: Re: how to create a menu without a list?
PostPosted: Wed Aug 05, 2009 6:24 pm 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 10681
Location: Arizona
You will have top make a new menu template, try the minimum one and remove all calls for ul and li...

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get it's parameters.
Right click and view source is a great way to see what you have to work with.
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/

Image


Top
 Profile  
 
 Post subject: Re: how to create a menu without a list?
PostPosted: Wed Aug 05, 2009 10:35 pm 
Offline
Forum Members
Forum Members

Joined: Wed Aug 05, 2009 12:27 am
Posts: 16
hexdj,
I think I did try it but maybe I'll give it another spin. Any hints on what CSS file I should use with it?

Dr. CSS,
Good idea, but can I insert a separator (like a pipe |) in there?


Top
 Profile  
 
 Post subject: Re: how to create a menu without a list?
PostPosted: Fri Aug 07, 2009 2:04 am 
Offline
Forum Members
Forum Members

Joined: Tue May 19, 2009 8:03 pm
Posts: 14
Lists have become the de facto standard for navigation. When we get our tag back it'll be even more sensible, but still a sort of list.

You can make a horizontal list with simulated pipes by adding this to your stylesheet...
Code:
.menu li{
  display: inline;
  list-style: none;
  border-left: 1px solid #000;
  padding: .5em 1em;
}
.menu li:first-child{
  border-left: none;
}


...then just give your
    a class of "menu".  Or do it the other way around, if your menu template already has a class attribute. Of course it won't work right in IE6; the border will be present on the left of the first item. *shrug* but nobody uses IE6 anymore.

    -Joe


Top
 Profile  
 
 Post subject: Re: how to create a menu without a list?
PostPosted: Tue Aug 11, 2009 12:44 am 
Offline
Forum Members
Forum Members

Joined: Wed Aug 05, 2009 12:27 am
Posts: 16
I was thinking that something to this effect could probably be whipped up with {cms_selflink dir="next"} and some PHP (which I sadly have not yet learned). Anybody have the skills to whip up something like this? It seems to me that it should be relatively simple. I'm also thinking it would involve at least one while statement (so you could take care of reaching the last page and all that).


Top
 Profile  
 
 Post subject: Re: how to create a menu without a list?
PostPosted: Tue Aug 11, 2009 10:36 pm 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 10681
Location: Arizona
Make a new menu template from a copy of the one used now and add a {$node->alias} to class of a then you can add an image in the CSS...

Or read the smarty manual to find the last call and use it in a menu template...

Or hire someone to make it for you...

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get it's parameters.
Right click and view source is a great way to see what you have to work with.
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/

Image


Top
 Profile  
 
 Post subject: Re: how to create a menu without a list?
PostPosted: Sun Aug 23, 2009 12:08 am 
Offline
Forum Members
Forum Members

Joined: Wed Aug 05, 2009 12:27 am
Posts: 16
Alright, I've got this working. With help from blue_francis14's post over here, I was able to write a simple pipe separated menu template. Parent/child distinction isn't really supported; all the active pages (children with inactive parents excluded because that's the way CMSms works) are shown one right after another with the pipe in between. The current page is non-linked. Here it is:

Code:
{* Constructed by Nathaniel Robertson (http://twitter.com/robertson_n) (http://forum.cmsmadesimple.org/index.php?action=profile;u=20682) with some help from CMS Made Simple forum member blue_francis14's version.
-----------------------------------------------------------------------------
Use the class .currentpage (no period, that's just the way you'd put it in CSS) to style the display of the menu item for the current page. Use .menuitem to style the other menu items (but not the current page). If you want to style the pipes (or whatever delimiter you change it to), create a span with a class name around them.
*}

{if $count > 0}
{foreach from=$nodelist item=node name=foo}

{if $node->current == true and $smarty.foreach.foo.last == true}
<span class="currentpage">{$node->menutext}</span>

{* more things  go after here *}

{elseif $node->current == true}
<span class="currentpage">{$node->menutext}</span> |

{elseif $smarty.foreach.foo.last != true}
<a href="{$node->url}"><span class="menuitem">{$node->menutext}</span></a> |

{else}
<a href="{$node->url}"><span class="menuitem">{$node->menutext}</span></a>

{* more things stop here *}
{/if}

{* end of script around here *}
{/foreach}
{/if}


blue_francis14's version works fairly well, too, especially if you want your menu in a
    list. I wrapped it in a div called middlenav in my template and used the following CSS to make it horizontal and get rid of the space above and below it when I was trying it out:
    Code:
    #middlenav {
     font-size: 17px;
     text-align: center;
     margin: -1em 0;
    }
    #middlenav li {
     display: inline;
    }


    The text-align and the font-size are really not necessary, it's just what I was using for styling. You may also want to check out this article to try and get the menu perfectly centered if that's what you want, since the inline displayed list is not perfectly centered even with text-align: center;. I haven't done it myself, by the way.

    Edit: 8.23.09: Edited my code to reflect a fix I made; their were a couple unclosed spans.


Last edited by ntmr on Mon Aug 24, 2009 12:50 am, edited 1 time in total.

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

All times are UTC


Who is online

Users browsing this forum: osxfil


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