menu customised - close but no cigar
Posted: Mon Dec 10, 2007 2:58 pm
Hi
Thanks to Calguy, I have made some advances in my first template and menu design. Considering this is my first ever CMSms (in fact first ever CMS site altogether) there is hope for all out there with menu problems.
OK I have got this far: http://www.i-dl.com/pmc
you'll see that the menu has dipped below the proper line height because of the visited link floating on the left!
Here is my css for the navigation:
#navbar {
height: 40px;
background: #8ca9da;
border-bottom: 1px #6780aa solid;
border-top: 1px #4b5d7b solid;
overflow: hidden;}
a.nav, a.nav:link, a.nav:visited {
display:block;
float: right;
height:30px;
padding-left: 10px;
padding-right: 10px;
margin-top: 10px;
text-align:center;
text-decoration:none;
font-family:verdana, arial, sans-serif;
font-size:12px;
color:#000;
line-height:35px;
overflow:hidden;
border-left: 1px #e9e9e9 solid;
border-right: 1px #6780aa solid;}
a.nav:hover {
text-decoration: underline;}
a.nav:active {
text-decoration: underline;}
I have also included the div tag #navbar in which the horizontal bar is held.
This is my pmc_hz_nav template code (hacked about from another posting)
{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->current == true}
url}">{$node->menutext}
{else}
url}">{$node->menutext}{/if}
{/foreach}
{/if}
and called from the page template like this:
{menu template='pmc_hz_nav' number_of_levels='1'}
Now, I assume that the smartycode is saying: for each item on the node list make a node, if the page is current make the link act accordingly to the behaviour of class currentnav from the template css, otherwise, dress it up as stated in the nav class. Both currentnav and nav will be coded into html in the form a [class] href=[the link defined by the page order] with the label [defined in the menu text].
Now I can back engineer this, but there would have been no way I could have designed this, so there may well be mistakes in there that I cannot see.
If you click on the final link of the menu, (farthest link on the left - the menu is floated right) then it starts to behave as I expect. Can anyone help me straighten out the menu?
I really appreciate the help and as you'll agree I'm almost there.
PS, to any gurus out there, please forgive the CSS, I suspect that it is not perfect but I am still learning so I use one entry per line.
Regards
Dave
Thanks to Calguy, I have made some advances in my first template and menu design. Considering this is my first ever CMSms (in fact first ever CMS site altogether) there is hope for all out there with menu problems.
OK I have got this far: http://www.i-dl.com/pmc
you'll see that the menu has dipped below the proper line height because of the visited link floating on the left!
Here is my css for the navigation:
#navbar {
height: 40px;
background: #8ca9da;
border-bottom: 1px #6780aa solid;
border-top: 1px #4b5d7b solid;
overflow: hidden;}
a.nav, a.nav:link, a.nav:visited {
display:block;
float: right;
height:30px;
padding-left: 10px;
padding-right: 10px;
margin-top: 10px;
text-align:center;
text-decoration:none;
font-family:verdana, arial, sans-serif;
font-size:12px;
color:#000;
line-height:35px;
overflow:hidden;
border-left: 1px #e9e9e9 solid;
border-right: 1px #6780aa solid;}
a.nav:hover {
text-decoration: underline;}
a.nav:active {
text-decoration: underline;}
I have also included the div tag #navbar in which the horizontal bar is held.
This is my pmc_hz_nav template code (hacked about from another posting)
{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->current == true}
url}">{$node->menutext}
{else}
url}">{$node->menutext}{/if}
{/foreach}
{/if}
and called from the page template like this:
{menu template='pmc_hz_nav' number_of_levels='1'}
Now, I assume that the smartycode is saying: for each item on the node list make a node, if the page is current make the link act accordingly to the behaviour of class currentnav from the template css, otherwise, dress it up as stated in the nav class. Both currentnav and nav will be coded into html in the form a [class] href=[the link defined by the page order] with the label [defined in the menu text].
Now I can back engineer this, but there would have been no way I could have designed this, so there may well be mistakes in there that I cannot see.
If you click on the final link of the menu, (farthest link on the left - the menu is floated right) then it starts to behave as I expect. Can anyone help me straighten out the menu?
I really appreciate the help and as you'll agree I'm almost there.
PS, to any gurus out there, please forgive the CSS, I suspect that it is not perfect but I am still learning so I use one entry per line.
Regards
Dave