SEO Services Las Vegas

Highlight Selected Primary Menu item

admin's picture

Selected Primary menu items are not highlighted in default themes. If you wish to have this feature as on

http://csqa.info then

You will have to

1. Modify Style sheet
2. Modify page.tpl.php
3. Need attached images.

1. Add the following to your .css file. I am using bluemarine theme

#primary {
float: left;
width: 100%;
/*background: url("bg.gif") repeat-x bottom;*/
font-size: 118%;
line-height: normal;
background-color: transparent;
}

#primary ul {
margin: 0;
padding: 8px 8px 0;
list-style: none;
}

#primary a, #primary strong, #primary span {
background: url("images/norm_right.gif") no-repeat right top;
padding: 5px 15px 4px 6px;
font-weight: bold;
text-decoration: none;
color: black;
background-color: #E0FFFF;
display: block;
}

#primary li {
/* Change the following entry to make the tabs line up to the left */
float: left;
background: url("images/norm_left.gif") no-repeat left top;
padding: 0 0 0 9px;
margin: 0;
list-style-type: none;
background-color: Aqua;
}

#primary #current {
background-image: url("images/norm_left_on.gif");
border-bottom: none;
background-color: #EEE8AA;
}

#primary #current a {
background-image: url("images/norm_right_on.gif") ;
font-weight: bold;
padding-bottom: 5px;
border-bottom: none;
color: #666633;

}

2. Comment & add the following to your page.tpl.php. Snippet from Bluemarine theme

<?php if (count($primary_links)) : ?>

    <?php foreach ($primary_links as $link): ?>
    <?php $class = ""; ?>

    <?php if ( stristr($link, 'active') ) : ?>
    <?php $class = 'id="current"'; ?>
    <?php endif; ?>

  • ><?php print $link?>
  • <?php endforeach; ?>

<?php endif; ?>

AttachmentSize
norm_left.gif1.04 KB
norm_left_on.gif531 bytes
norm_right.gif1.23 KB
norm_right_on.gif1.54 KB
norm_right_on.gif1.54 KB
Share/Save

User login