[solved] How to make a menu with different buttons

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
Raxbany
New Member
New Member
Posts: 3
Joined: Sat Mar 14, 2009 1:01 am

[solved] How to make a menu with different buttons

Post by Raxbany »

Hi, I am new to CMSMS.

I was wondering how to make something like that with CMSMS, the simplest way possible
Image

I looked at some stuff on the net but still Im not sure how to do that
I know html/css basics (ie : I know I have to make several id class, one for each button, and then modify each one of them with a css, but where? the html template is empty, the menu seems to be elsewhere but cannot find it)

here is the menu in the html template
{* Start Navigation *}
     
         {menu template='simple_navigation.tpl' collapse='1'}
     
      {* End Navigation *}

so I guess I have to make my ID classes elsewhere.. in the simple_navigation.tpl right? but how to modify it? it seems I cant open it

your help will be greatly appreciated, best regards
Last edited by Raxbany on Mon Mar 16, 2009 3:57 pm, edited 1 time in total.
Raxbany
New Member
New Member
Posts: 3
Joined: Sat Mar 14, 2009 1:01 am

Re: [solved] How to make a menu with different buttons

Post by Raxbany »

The solution was on a very recent thread

Here is what I did

My menu template
{* CSS classes used in this template:
.activeparent - The top level parent when a child is the active/current page
li.active0n h3 - n is the depth/level of the node. To style the active page for each level separately. The active page is not clickable.
.clearfix - Used for the unclickable h3 to use the entire width of the li, just like the anchors. See the Tools stylesheet in the default CMSMS installation.
li.sectionheader h3 - To style section header
li.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->current == true}
Current page is {$node->hierarchy}: {$node->menutext}

{elseif $node->parent == true}
menutext}">url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}>{$node->hierarchy}: {$node->menutext}

{elseif $node->type == 'sectionheader'}
{$node->menutext}

{elseif $node->type == 'separator'}


{else}
menutext}">url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}>{$node->hierarchy}: {$node->menutext}

{/if}

{/foreach}
{repeat string="" times=$node->depth-1}

{/if}
My CSS
/********************
MENU
*********************/
#menu_vert {
   padding-left: 0;
   margin-left: 1em;
width: 180px;

}


/* third level has some padding to have it stand out */
div#menu_vert ul ul ul {
   padding-bottom: 0.5em;
}

/* menu li block */
#menu_vert li {
   list-style: none;
   margin: 0;
   border-bottom: 1px solid #081073;
   display: block;
}

#menu_vert ul ul li {
   border: none;
}

/** fix stupid ie bug with display:block; **/
* html #menu_vert li a { height: 1%; }
* html #menu_vert li hr { height: 1%; }
/** end fix **/

/* first level links */
div#menu_vert a {
   text-decoration:none; /* no underline for links */
   display: block; /* IE has problems with this, fixed above */
   padding: 0.8em 0.5em 0.8em 1.5em; /* some air for it */
   color: #2F3584; /* this will be link color for all levels */
 
   bckground-repeat: no-repeat 0.5em center;
   min-height:1em; /* Fixes IE7 whitespace bug */
}

/* next level links, more padding and smaller font */
div#menu_vert ul ul a {
   font-size: 90%;
   padding: 0.5em 0.5em 0.5em 2.8em;
   background-position: 1.5em center;
}

/* third level links, more padding */
div#menu_vert ul ul ul a {
   padding: 0.3em 0.5em 0.3em 4.3em;
   background-image: url(http://c2ilettres.u-bourgogne.fr/etudia ... /array.gif);
   background-repeat: no-repeat 2.8em center;
}

/* hover state for all links */
div#menu_vert a:hover {
   background-color: #BF9930;
}
div#menu_vert a.activeparent:hover {
   background-color: #FFCC40;
   color: #2F3584;
}

/*
active parent, that is the first-level parent
of a child page that is the current page
*/
div#menu_vert li a.activeparent {
   background-image: url(http://c2ilettres.u-bourgogne.fr/etudia ... /array.gif);
   background-repeat: no-repeat 0.4em center;
   background-color: #FFCC40;
   color: #2F3584;
}

div#menu_vert ul ul li a.activeparent {
   background-position: 1.5em center;
   background-color: transparent;
   color: #081073;
}


/*
current pages in the default Menu Manager
template are unclickable. This is for current page on first level
*/
div#menu_vert ul h3 {
   background: url(http://c2ilettres.u-bourgogne.fr/etudia ... /array.gif) no-repeat 0.4em center;
   background-color: #FFCC40;
   display: block;
   padding: 0.8em 0.5em 0.8em 1.5em;  /* some air for it */
   color: #2F3584;                                 /* this will be link color for all levels */
   font-size: 1em;                           /* instead of the normal font size for */
   margin: 0;                                  /* as normally has some margin by default */
}

/*
next level current pages, more padding,
smaller font and no background color or bottom border
*/
div#menu_vert ul ul h3 {
   font-size: 90%;
   padding: 0.3em 0.5em 0.3em 2.8em;
   background-position: 1.4em center;
   background-color: #FFCC40;
   border-bottom: none;
   color: #000;     
}

/* current page on third level, more padding */
div#menu_vert ul ul ul h3 {
   padding: 0.3em 0.5em 0.3em 4.3em;
   background-image: url(http://c2ilettres.u-bourgogne.fr/etudia ... /array.gif);
   background-repeat: no-repeat 2.7em center;
}

/* section header */
div#menu_vert li.sectionheader {
   border-right: none;
   font-size: 130%;
   font-weight: bold;
   padding: 1.5em 0 0.8em 0;
   background-color: #FFCC40;
   line-height: 1em;
   margin: 0;
   text-align:center;
}



/* separator */
div#menu_vert li.separator {
   height: 1px !important;
   margin-top: -1px;
   margin-bottom: 0;
   padding:2px 0 2px 0;
   background-color: #000;
   overflow:hidden !important;
   line-height:1px !important;
   font-size:1px; /* for ie */
}

div#menu_vert li.separator hr {
   display: none; /* this is for accessibility */
}


/* personnalisation */

div#menu_vert ul li.Accueil a {
   background-image ...
  }

div#menu_vert ul li.Accueil a:hover {
   background-image ...
   }

of course CSS isnt finished but you get the idea..
Raxbany
New Member
New Member
Posts: 3
Joined: Sat Mar 14, 2009 1:01 am

Re: [solved] How to make a menu with different buttons

Post by Raxbany »

cant see my reply  :o

here it is again...
The solution was on a very recent thread

Here is what I did

My menu template
{* CSS classes used in this template:
.activeparent - The top level parent when a child is the active/current page
li.active0n h3 - n is the depth/level of the node. To style the active page for each level separately. The active page is not clickable.
.clearfix - Used for the unclickable h3 to use the entire width of the li, just like the anchors. See the Tools stylesheet in the default CMSMS installation.
li.sectionheader h3 - To style section header
li.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->current == true}
Current page is {$node->hierarchy}: {$node->menutext}

{elseif $node->parent == true}
menutext}">url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}>{$node->hierarchy}: {$node->menutext}

{elseif $node->type == 'sectionheader'}
{$node->menutext}

{elseif $node->type == 'separator'}


{else}
menutext}">url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}>{$node->hierarchy}: {$node->menutext}

{/if}

{/foreach}
{repeat string="" times=$node->depth-1}

{/if}
My CSS
/********************
MENU
*********************/
#menu_vert {
   padding-left: 0;
   margin-left: 1em;
width: 180px;

}


/* third level has some padding to have it stand out */
div#menu_vert ul ul ul {
   padding-bottom: 0.5em;
}

/* menu li block */
#menu_vert li {
   list-style: none;
   margin: 0;
   border-bottom: 1px solid #081073;
   display: block;
}

#menu_vert ul ul li {
   border: none;
}

/** fix stupid ie bug with display:block; **/
* html #menu_vert li a { height: 1%; }
* html #menu_vert li hr { height: 1%; }
/** end fix **/

/* first level links */
div#menu_vert a {
   text-decoration:none; /* no underline for links */
   display: block; /* IE has problems with this, fixed above */
   padding: 0.8em 0.5em 0.8em 1.5em; /* some air for it */
   color: #2F3584; /* this will be link color for all levels */
 
   bckground-repeat: no-repeat 0.5em center;
   min-height:1em; /* Fixes IE7 whitespace bug */
}

/* next level links, more padding and smaller font */
div#menu_vert ul ul a {
   font-size: 90%;
   padding: 0.5em 0.5em 0.5em 2.8em;
   background-position: 1.5em center;
}

/* third level links, more padding */
div#menu_vert ul ul ul a {
   padding: 0.3em 0.5em 0.3em 4.3em;
   background-image: url(array.gif);
   background-repeat: no-repeat 2.8em center;
}

/* hover state for all links */
div#menu_vert a:hover {
   background-color: #BF9930;
}
div#menu_vert a.activeparent:hover {
   background-color: #FFCC40;
   color: #2F3584;
}

/*
active parent, that is the first-level parent
of a child page that is the current page
*/
div#menu_vert li a.activeparent {
   background-image: url(array.gif);
   background-repeat: no-repeat 0.4em center;
   background-color: #FFCC40;
   color: #2F3584;
}

div#menu_vert ul ul li a.activeparent {
   background-position: 1.5em center;
   background-color: transparent;
   color: #081073;
}


/*
current pages in the default Menu Manager
template are unclickable. This is for current page on first level
*/
div#menu_vert ul h3 {
   background: url(array.gif) no-repeat 0.4em center;
   background-color: #FFCC40;
   display: block;
   padding: 0.8em 0.5em 0.8em 1.5em;  /* some air for it */
   color: #2F3584;                                 /* this will be link color for all levels */
   font-size: 1em;                           /* instead of the normal font size for */
   margin: 0;                                  /* as normally has some margin by default */
}

/*
next level current pages, more padding,
smaller font and no background color or bottom border
*/
div#menu_vert ul ul h3 {
   font-size: 90%;
   padding: 0.3em 0.5em 0.3em 2.8em;
   background-position: 1.4em center;
   background-color: #FFCC40;
   border-bottom: none;
   color: #000;     
}

/* current page on third level, more padding */
div#menu_vert ul ul ul h3 {
   padding: 0.3em 0.5em 0.3em 4.3em;
   background-image: url(array.gif);
   background-repeat: no-repeat 2.7em center;
}

/* section header */
div#menu_vert li.sectionheader {
   border-right: none;
   font-size: 130%;
   font-weight: bold;
   padding: 1.5em 0 0.8em 0;
   background-color: #FFCC40;
   line-height: 1em;
   margin: 0;
   text-align:center;
}



/* separator */
div#menu_vert li.separator {
   height: 1px !important;
   margin-top: -1px;
   margin-bottom: 0;
   padding:2px 0 2px 0;
   background-color: #000;
   overflow:hidden !important;
   line-height:1px !important;
   font-size:1px; /* for ie */
}

div#menu_vert li.separator hr {
   display: none; /* this is for accessibility */
}


/* personnalisation */

div#menu_vert ul li.Accueil a {
   background-image ...
  }

div#menu_vert ul li.Accueil a:hover {
   background-image ...
   }

of course CSS isnt finished but you get the idea..
Last edited by Raxbany on Mon Mar 16, 2009 4:06 pm, edited 1 time in total.
Post Reply

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