*Disclaimer*
I have tested this only in Firefox 3 only. I would appreciate if people could post back any formatting problems with other browsers with screen shots so that I can fix them. Thanks in advance.
This post is for those who would like to use the Superfish menu module but have a style close to Bartik for the main navigation.
- Create new style sheet (NewStyleSheet.css) and save it to your file directory (e.g., I placed mine in cd%drupalDirectory%\sites\all\files\styles\NewStyleSheet.css).
- Edit Block settings for Superfish assuming you are using a template that includes a "Menu Bar" or similar block area. Do this in /admin/structure/block.
- Move Superfish X...in my case I used Superfish 3...to the Menu Bar Region by changing the dropdown selector to Menu Bar.
- Click Configure under Operations on the far right.
- Under Superfish Settings, change Menu Type to NavBar
- I selected NO on both Drop shadows and Auto-arrows as this would take more time to modify the CSS to get them to show up properly. This can be done, however it is not part of this DIY.
- In Advanced Settings, add your new stylesheet location to Extra CSS (e.g., cd%drupalDirectory%\sites\all\files\styles\NewStyleSheet.css).
- !Important! If you want to see a full width secondary navigation background, you must do this following if you are using the Pixture Reloaded theme. Open cd%drupalDirectory%\sites\default\files\color\pixture_reloaded-######\colors.css (or where your files are stored) and go to line 264 and make it look like this.
- <code>.sf-navbar.sf-style-default li ul {
/*background-color: transparent !important;*/ /*Comment this line so that the style in the NewStylesheet.css will allow for a full background.*/<br /> width: 100%;<br /> }</code>
- <code>.sf-navbar.sf-style-default li ul {
- !Important! With the above in line #3 still open, comment line #253 which says /*background: #4f5152*/
- It is listed under:
<code>.sf-menu.sf-style-default li:hover,.sf-menu.sf-style-default li.sfHover,<br /> .sf-menu.sf-style-default li.active a,<br /> .sf-menu.sf-style-default a:focus,<br /> .sf-menu.sf-style-default a:hover,<br /> .sf-menu.sf-style-default a:active,<br /> .sf-navbar.sf-style-default li li {<br /> /*background: #4f5152;*/<br /> }</code>
- It is listed under:
- Option: I removed the shadow in the default superfish.css on line 131 and 234. It didn't work with my styles and I didn't want to spend any extra time on it.
- Copy styles from the attached stylesheet to your new stylesheet. !Important! make sure that your to replace #superfish-3 with the same number as you used for your Superfish module #Number# (e.g., I used Superfish 3 module, hence my stylesheet names will be #superfish-3).
CSS file attached
/* $Id: whiteTab.css,v 1.0 2011/02/18 05:45:00 erok415 Exp $ */
/*-------------------------------------------------------------*/
/* */
/* !Important! - Be sure to change all references */
/* from #superfish-3 below to match the number of the */
/* Superfish "X" block region you are using in your */
/* Block Settings. I used block region Superfish 3, */
/* hence I am using #superfish-3 below. */
/* */
/*-------------------------------------------------------------*/
/*-------------------------------------------------------------*/
/* */
/* I have not attempted to use style the 4th level flyout, */
/* Auto-arrows or the drop shadow features. */
/* */
/*-------------------------------------------------------------*/
#menu-bar{
margin-bottom:10px;/*Add padding so secondary navigation doesn't run over search sidebar*/
}
sfHover, ul#superfish-3 > li:hover{
background: none repeat scroll 0% 0% transparent;/*Remove default background on top level tabs in default state and hover state*/
}
ul#superfish-3 li.sfHover li a:hover, ul#superfish-3 li.sfHover li a.active{/*Secondary Nav: add effect to hover or active state here*/
color:#09F;
width:100%;
}
ul#superfish-3 > li > a{/*Fist level horizontal navigation*/
margin:4px 2px 0 0;/*Spacing around tabs*/
color: #333;
background: #fff;
background: rgba(255, 255, 255, 1.0);
float: left; /* LTR */
padding:0px 6px 6px 6px;
/*height: 1.8em;
line-height: 2.4em;
padding: 0 0.8em;*/
text-decoration: none;
/*text-shadow: 0 0.5px #999;*/
font-weight:bold;
-khtml-border-radius-topleft: 8px;
-khtml-border-radius-topright: 8px;
-moz-border-radius-topleft: 8px;
-moz-border-radius-topright: 8px;
-webkit-border-top-left-radius: 8px;
-webkit-border-top-right-radius: 8px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
ul#superfish-3 > li.sfHover {
background: none repeat scroll 0% 0% transparent;/*Remove default background from sfHover state*/
}
ul#superfish-3 > li.sfHover > a { /*First level hover and active state*/
margin:4px 2px 0 0;/*Spacing around tabs*/
color: #333;
background: #999;
background: rgba(153, 153, 153, 1.0);
float: left; /* LTR */
padding:0px 6px 6px 6px;
/*height: 1.8em;
line-height: 2.4em;
padding: 0 0.8em;*/
text-decoration: none;
/*text-shadow: 0 0.5px #999;*/
font-weight:bold;
-khtml-border-radius-topleft: 8px;
-khtml-border-radius-topright: 8px;
-moz-border-radius-topleft: 8px;
-moz-border-radius-topright: 8px;
-webkit-border-top-left-radius: 8px;
-webkit-border-top-right-radius: 8px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
/*----------------Secondary Nav-------------------*/
.sf-navbar > li > ul{/*add background color to secondary nav only*/
background:none repeat scroll 0% 0% rgb(51, 51, 51);
background: #333;
}
ul#superfish-3 > li > ul{
left:-15px;/*align menu with left edge of design*/
border-right:30px solid #333;/*add background color to right edge because style attribute above leaves a blank spot due to global conditions*/
}
ul#superfish-3 > li > ul > li {
left:15px;/*Fix: aligns secondary level nav text with top level nav*/
border:0;
}
ul#superfish-3 > li.sfHover > ul > li > a{/*Secondary Nav: Remove tab effect from sfHover state applied to lower level nav*/
color:#fff;
background: #333;
-khtml-border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-top: 0px;
border-radius: 0px;
width:100%;
height:2.0em;
line-height:1.1em;
padding:6px 0 0 6px;
margin:0 16px 0 0;
}
ul#superfish-3 > li > ul > li > a{/*secondary horizontal navigation*/
color:#fff;
font-weight:bold;
/*text-shadow: 0 0.5px #CCC;*/
background: none repeat scroll 0% 0% transparent;
-khtml-border-radius:0;
-moz-border-radius:0;
-webkit-border-radius:0;
padding:0;
}
/*---------------Third level DropDown navigation------------*/
ul#superfish-3 > li > ul > li > ul {
-khtml-border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-top: 0px;
border-radius: 0px;
margin:0;
padding:0 0 0 6px;
border:0;
left:-0px;
background: none repeat scroll 0% 0% transparent;
}
ul#superfish-3 > li > ul > li > ul > li {
margin:0px;
border-right:0;
left:0;
border:0;
padding:6px 6px 0px 6px;
background:#333;
}
ul#superfish-3 > li > ul > li > ul > li:hover{
}
ul#superfish-3 > li > ul > li > ul > li > a {
background:#333;
margin:0;
padding:0 6px 0px 6px;
line-height:1.3em;
background:#333;
}
ul#superfish-3 > li > ul > li > ul > li > a:hover {
background: none repeat scroll 0% 0% transparent!important;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | whiteTab.zip | 1.39 KB | erok415 |
| whiteTab.zip | 1.37 KB | erok415 |
Comments
Comment #1
jhodgdonMoving to correct issue queue and fixing tags and status.
I'm guessing this would be a theme snippet?
Comment #2
erok415 commentedthanks, I'm still new.
E.
Comment #3
erok415 commentedI found a problem with the Third level DropDown navigation which I fixed. Code is below or you can use the zip file.
Comment #4
arianek commentedshould this go in theme snippets http://drupal.org/node/45471 or as a subpage of bartik theme http://drupal.org/documentation/themes/bartik - 2nd opinions?
Comment #5
avpadernoI would put it in the theme snippets. Somebody who would need to do something similar with a different theme could take what reported it as guide; if the snippet is listed as sub-page of Bartik, then it is probable it would pass unobserved; users could think "I don't need to do it for Bartik, but XYZ," and not watch at the page reporting this snippet.
Comment #6
Carolyn commentedWhich part of this is Bartik specific? Is the where to place the menu?
Comment #7
arianek commentedComment #8
greg0ryv commentedI feel like I'm missing something. When I implement this in Drupal 7, the menu shows all items listed in a row. So, MainMenuItem-SubItem-SubItem, MainMenuItem-SubItem-SubItem-MainMenuItem.
No clue why its doing this. I checked the main menu and the contents are correctly structured. I tried a different menu, same problem.
So far, drupal navigation menus are extremely frustrating for me.
Comment #9
rahul_sankrit commentedHi,
I were facing the same issue with Bartik Theme. Now My issue has been fixed.
I followed this link : https://www.drupal.org/node/1508652
Thanks
Kumar Rahul Sankrit
Comment #10
saurabh.dhariwal commentedComment #11
quietone commentedBartik is now a contributed project. This can be added to that projects documentation, https://www.drupal.org/project/bartik