Pardon my Noobness as this is my first Drupal site. While there is a TON of great information here, the newness of D7 makes it sometimes difficult to determine how valid the information is when its not specifically labeled as such.. so..
I am using Drupal 7 and the provided Bartik theme.
Just so I am clear, in order to get the "children" links on a Main menu to display as drop down items of their parents, I must install a module such as NiceMenus or Superfish (or write my own).
In other words, there is no "out of the box" core method of displaying the children/grandchildren in the HEADER areas using the default Bartik theme and D7?
Thanks.
Chris
Comments
I'm having the same issue,
I'm having the same issue, Chris. I will post back here if I find the solution.
superfish
I ended up installing the superfish module, then creating a copy of the Bartik theme, modifying it to support (replace main menu region) a superfish region...
I really like D7, and I love that there is sooooo much documentation etc. But its a real challenge to be starting with D7 and 'filtering' out how tos, etc that are for 5 or 6..
More details
Subscribe.
(Currently I have the same problem. Can you please post what you did with more details?)
child-menu
Hi,
in the template.tpl.php:
replace
if (isset($vars['main_menu'])) {
$vars['primary_nav'] = theme('links__system_main_menu', array(
'links' => $vars['main_menu'],
'attributes' => array(
'class' => array('links', 'inline', 'main-menu'),
),
'heading' => array(
'text' => t('Main menu'),
'level' => 'h2',
'class' => array('element-invisible'),
)
));
}else{
$vars['primary_nav'] = FALSE;
}
by
if (isset($vars['main_menu'])) {
$pid = variable_get('menu_main_links_source', 'main-menu');
$tree = menu_tree($pid);
$tree = str_replace(' class="menu"', '', $tree);
$vars['primary_nav'] = drupal_render($tree);
}else{
$vars['primary_nav'] = FALSE;
}
and then in the page.tpl.php
where you want to display the main menu
It worked for me, hope it helps,
david
Thanks, i'll try.
Thanks, i'll try.
where did you do that
hey david,
in my themes->bartik i found no file calls template.tpl.php. i have only the file template.php and in this there are not the lines to replace. i found this lines only in the garland theme. When you do this in the garland theme, can you explain me how to do this in the bartik theme?
Thanks
same same
Hi gandhi,
sorry i was out for few days. I don t know if you ve already figured out but it is the same way .
In the bartik folder first you ve got a template.php where you put the code i told you before.
Then there is another folder called templates. Open it and you ll find a template page.tpl.php where you put the code i told you for the page.tpl.php
And this should work,
bye
Hi David, I cannot find this
Hi David,
I cannot find this code in template.php of bartik
if (isset($vars['main_menu'])) {
$vars['primary_nav'] = theme('links__system_main_menu', array(
'links' => $vars['main_menu'],
'attributes' => array(
'class' => array('links', 'inline', 'main-menu'),
),
'heading' => array(
'text' => t('Main menu'),
'level' => 'h2',
'class' => array('element-invisible'),
)
));
}else{
$vars['primary_nav'] = FALSE;
}
The only reference to menu trees I could find is this line
/**
* Implements theme_menu_tree().
*/
function bartik_menu_tree($variables) {
return '
' . $variables['tree'] . '
';
}
Are you sure the above code is from template.php in bartik?
Finally suceeded by
Finally suceeded by installing nice menu, applying this patch http://drupal.org/node/1002054 and using the theme function
print theme('nice_menus_primary_links');
Sorry Guys not to answer
Sorry Guys not to answer before..
So i ve just tried with bartik theme and it worked well.
Just to change a bit the code like that:
Open page.tpl and put:
It worked for me, hope it helps,
bye
For all of us who are still
For all of us who are still trying to put the various "do this" pieces together, can someone with WAY MORE Drupal experience than us tell us one more time (in idiot proof format) how to get the Bartnik theme to utilize drop-down menus with their current look? Some of the code we can't find in template.php in order to replace the code.
Thanks so much!
Hi brian, Put this simple
Hi brian,
Put this simple code in page.tpl where your want to appear your menu . I am still a newbie with drupal but i am focusing in learning as this cms is convencing me a lot.
print(render(menu_tree('main-menu')));
This code works .I ve tried it .
Hope it helps u,
bye
Do you have a URL where I can
Do you have a URL where I can see what it looks like? I want to use Nice Menu but keep the same "style" as Bartnik instead of the choppy Nice Menu blocks.
Need idiot proof solution for this
I agree with Brian.
I tried to understand what's written on this page and very little of it makes sense for one single reason: all solutions are scattered and there is no solid instruction.
which "PAGE.TPL" are we talking about? the one that's in the theme folder? The ones I've got are all ending with page.tpl.php....
it's work thank you
it's work thank you
Clarification
I think what everyone is trying to say is that you are leaving out some crucial steps to make Superfish menu's work with the Bartik theme.
I currently have Superfish menu's module installed and have turned on Superfish 3 menu in the header block region from within the blocks settings at admin/structure/block. This places the Superfish menu right below the "My Account / Log out" or on the far right of the page in the header. Obviously this is not what I or anyone would like to achieve by replacing the "main menu" with Superfish menus.
Questions:
1. Should Superfish menus be turned on?
2. What blocks should be enabled and where?
I found the code you are referring to in the Bartik theme. If anyone hasn't modified the Bartik theme code, you should be able to find it on line 126 through 141 (see below).
If I understand you (DavidAndre) correctly, you suggest replacing it with:
With Superfish menu 3 enabled, this setup does nothing more than turn the current "main menu" into a list with out styles which screws up the navigation design.
Please help us understand how you were able to get the Superfish menu's integrated into where the current "main menu" navigation is (in the standard Bartik theme.
I appreciate your trying to help some of us get over this hurdle.
E.
Ain't it great....!
Change of direction for menu integration
First off, I'm working with D7.
I found that if you want to install Superfish menus, it's good to start with a theme that has a block area named "Menu Bar" or something similar in /admin/structure/block. This is where you can apply your Superfish menu.
Here is a couple of steps that I did to get Superfish menus working with great success.
I hope this helps anyone trying to get Superfish menus to work.
E.
Ain't it great....!
Challenging indeed
Indeed, coming from Wordpress 3.1 development and working in Drupal 7 for the first time I am appalled at how much basic functionality is simply missing or only available in a buggy alpha version which requires patches. Sifting though incomplete and out of date documentation is a real bear.
Nice Menus does it.
Thank you bluecafe! You finally ended my frustration after hours of searching for a solution to this major issue with drupal 7. Now I only wish we could keep the Bartik style of the main menu, but I can live without it.
That's what I'm trying to accomplish too
I'm like you. I can get Nice Menus to work just fine. However, I want it to "look" like Bartnik's original theme and still give the ability for drop down menus. Anyone have luck with this?
Heres how to Guide to apply Bartik main-menu styles to Superfish
It took me a few days to get this right while testing the the best styles to achieve this goal. See this post I created which gives a step-by-step instruction how to create rounded Bartik style tabs to the top nav position.
E.
See post: http://drupal.org/node/1073298
Ain't it great....!
Good solution
Hi, with a bit of hacking, I've made standard javascript superfish menus work with the Bartik theme. Take a look at my solution. There's a demo link near the top of the page so that you can try it out before following any instructions.
Quick question
Thank you for your post. I am a drupal newbie as well and I have been searching and searching for a solution that I felt I could pull off. I created a sub theme based on bartik and followed your instructions. I was able to get the beautiful drop down menus to work but I have encountered a small snag. The sub-menus only appear when I have clicked on their parent page. I cannot get figure out how to get them to cascade when I scroll the mouse over the main menu, as you have achieved on your demo site. Any idea where I may have gone wrong?
Thanks for your time!
One last step...
My Emerging Light, I should have mentioned this on my help page (I'll go and add it now)... Every parent item that has children must have "Show as expanded" checked on its edit page. Sounds like you've got everything else working. :-)
You are a gem!
Thanks, jjwhitney. This worked beautifully. I had added the menu tab to the main menu bar independently so while I had checked the "show as expanded" on the page that was the path for the menu link, I had neglected to edit the check the box the menu link itself. It is now working perfectly. Thanks for your help and thanks for getting back to me so quickly!
Hi, thanks for ur work and
Hi, thanks for ur work and well done it is working! there's a few error messages pointing to unexisting images that were meant to be in a folder under css?
Thanks
Many thanks
Many thanks for creating Bartik Plus - the lack of dropdown menus was a major hurdle for a site I've got to have done by next week. Seems strange it wasn't built into the original since it's rare not to have children for main site menu items. You have saved me many hours!
many thanks for Bartik Plus
As a noob to Drupal ( or any web design for that matter :) I appreciate simple solutions and yours ticks the boxes. :)
many thanks for making this readily available. Now all we have to do is mod the Bartik Plus theme to allow for modification of the default fonts and I will be very happy.
Cheers
Hazmoid
Basic Way
Edit: Cancel This! Doesn't work in Bartik or Garland. [end Edit]
It's taking me a long time to sort this out too. Here's a basic way:
Go to Structure/Menus
In the Main Menu row, click 'List Links'
Under 'Menu Link', find an item you want to be a child; click 'edit' for it
Under 'Parent link', choose from the drop-down menu the item you want to be the parent in the menu
Click 'save'
While this works, there are a couple of problems:
1) Drupal apparently requires a 'parent' link to link to a node. Appears quite stupid--in a drop-down menu, when you hover over the parent item, a menu occurs beneath it, but the parent item doesn't itself link to a page.
2) In the above, after you click 'List Links', in the box of links, there can be an icon with arrows pointing up/down/left/right, and moving this icon around lets you move items in the menu easily. It's not appearing in my default distribution of Drupal 7, but it appears in a distribution I got with a Theme that I purchased. I'd like to know how to get this menu-alterer working.
Default Drupal 7 installation
Basic Way, I haven't experienced the troubles you're running into. I was able to drag all my menu items around with a fresh Drupal 7 installation. Also, I don't understand what you mean about the parent item. My parent items can link to pages without any problem, see this site with dropdown menus. Does this have anything to do with my solution which creates drop-down menus in Bartik? Or is this a general Drupal problem?
Subtheme now available
Hi everyone. I've created a subtheme for Bartik so that everyone wanting drop-down menus can have a dead-simple and efficient solution for this problem. Enjoy!
Thank you jjwhitney for the
Thank you jjwhitney for the Bartik Plus. I have the question according drop down menu.
Let's say we've got Parent_menu_item_1 with some sub menu items and Parent_menu_item_2. Now when Parent_menu_Iitem_2 is active and I place mouse cursor over Parent_menu_item_1 drop down menu doesn't appear. It is avaliable only when Parent_menu_item_1 has been clicked first. I would like drop downs to appear any time. Do you know how I can make it?
Show as expanded
aniak, just edit the Parent_menu_item_1 link, and check the box that says "Show as expanded". This ensures that its children are loaded even when the parent link is not active.
Thank you, it worked
Thank you, it worked perfectly. I don't know why I didn't notice that option.
Thank You
Thanks JJ. I just used your theme and it works great. For those who are complete newbs like me. Getting to show expanded is: Structure->Menu->Main menu->list links> edit (chosen parent link)-> Show as expanded. Thanks again JJ.
Great Job!
Thanks for this... Works great! Really appreciate the help. Is there a simple way to change the background color of the child links?
Background color
ret5: Sure, you can theme the child links by editing the file "css/menu_style.css". The background color is given by this line:
Just change "#EEF" to the desired color. You can do a web search for "css colors" if you want some examples.
Download the theme again, if you can, before making the change, since I have just fixed an Internet Explorer issue which is described below.
Variable suggestion
Thanks a zillion for this great theme.
Would it be possible to set the background color to use one of the theme variables instead of a fixed value? In other words, if I change the site from blue to red in the theme's interface, the menu background color follows?
This would also be helpful when running multiple sites (no need to copy and maintain a version of Bartik Plus in each site)
jjwhitney, The following
jjwhitney,
The following should be added to template.php to automatically mark menu items as "expanded"
having trouble installing it
I just downloaded your theme, but am having trouble installing it. I get this error message:
Cannot extract temporary://bartik_plus-0.3.1.tgz.gz, not a valid archive. Any suggestions?
How to extract files
It looks like your browser has mangled the file name. Try removing the final ".gz" so that the name is: "bartik_plus-0.3.1.tgz". I can also send you a ".zip" file if you prefer.
help me, i can not do it
I have installed, but it does not work, you can guide more specific?
Is Bartik Plus still available?
I'm dying to use this solution and save lots of work (ok, some work). Unfortunately, on Drupal project git repository seems to be empty. On the other hand the download page seems down (I'm receiving gateway timeout response). Is there any way to download the Bartik Plus subtheme?
Problem with jjwhitney's Bartik Drop Down in IE
Works properly in Firefox but errors in IE7. Dropdown gets covered by Blocks. Any fix?
Here is a Screen Shot
http://img21.imageshack.us/i/error2dk.jpg/
Fixed now
whodatis: Thanks for noticing that. I've fixed the problem with IE7. Let me know if you see anything else.
Problem with jjwhitney's Bartik Main Menu Link
First thank you to jjwhitney for this theme.
I do have two problem regarding main menu link :
1. My main menu can't show active link style.
2. Sub menu only showed when parent link is active. As illustration, while on HOME page, If mouse cursor point on menu ABOUT US, I couldn't see ABOUT US' sub menus. But, while on ABOUT US page, If mouse cursor point on menu ABOUT US, I could see ABOUT US' sub menus.
FYI, Tested using FF 3.6.15, Chrome 10 on Ubuntu Lucid (10.04).
Please help me...
Bartik Plus Updated
Hi ardinotow, I've updated Bartik Plus so that active links are highlighted. Your second question was already asked by aniak. See the answer above. I've added some more new features and haven't thoroughly tested, so please let me know if you run into any problems.
Thanks man, thats really
Thanks man, thats really good, any chance of changing the background or font color of the menu items that are expanded?
E.g.
if I have menu2 expanded make menu2 text bold so I know where the menu is expanding from?
Thanks
Submenu is behind "highlight" block
Hi JJ, thank you so much for your support. The submenu works fine on my site www.bergenchineseschool.com/drupal, however, the submenu is covered by "highlight" block. Could you show me know how to fix it? Thank you!
Solutions
I found the solution.
Edit ddblock.css in ddblock module folder, and set z-index to 0.
.ddblock-container {
clear:both;
position: relative;
z-index:0;
}
It works!
Drop-down menu being hidden
Hi !
I love Bartik Plus - great great enhancement! Congrats!
However I find myself in a situation which resembles the one above, only I can't find any ddblock module to edit its css.
The first menu has nine items. The first sidebar has the search box and a second block (rotating banner). The first menu correctly drops "in front" of the search box block, but its two last items go further down and drop "behind" the rotating banner block ...
Can anyone advise ? Maybe I can find a way to move the rotating banner block further down, but I'd rather a cleaner solution.
Many thanks
From what I understand I need
From what I understand I need to tell the rotating banner module that it's z is zero ?
I'll investigate and post back. It does have a css so there is something to look into.
cheers
solved
Edit the rotating_banner.css and add z-index: 0; to .rotating-banner .rb-slides
Details here:
http://drupal.org/node/1209712#comment-4696408
Cheers
DDBlock mod - cleared cache and ran cron to make work
Just adding some detail. I made the 'z-index:0;' change but it had no effect. Needed to clear cache and ran cron then it worked perfectly.
Multilingual site shows all links, regardless of language
Hi, I installed bartik plus and the dropdown menus worked like a charm. But my site is multilingual, and although previously with bartik only the menu links from my selected language showed up, now all links from all languages appear.
This happens only with links which have been given a language manually, the links which take the language from the node behave like they are supposed to.
¿Any ideas anyone? Thanks
Does anyone also have
Does anyone also have drop-down working for Garland theme?
How to make "Show as expanded" default
The following should be added to template.php within the bartik_plus subtheme submitted above by jjwhitney
This automatically marks menu items as "expanded" upon their creation (e.g. when creating a page and adding it to the primary links menu during the page creation process).
Thank you!
Thank you for developing the Bartik-plus sub-theme. It is exactly what I needed for my site!
Can't extract Bartik Plus download
I can't seem to extract files from the Bartik Plus download file. I get an error message. Anyone having that problem?
I just downloaded from
I just downloaded from http://deltup.org/e107_files/downloads/bartik_plus-0.3.1.tgz and opened it with WinRAR without any issues.
@bluecafe where did u use the
@bluecafe where did u use the function?
Please clarify installation requirements
Looks like the Bartik Plus is exactly what I have been looking for but I am not having any luck in making it work. Here are the steps I have taken:
- installed bartik plus theme and enabled
- installed superfish module and enabled
- added 2 links 2 main menu, 1 a child of the other with defined parent
- selected 'show as expanded' for everything
No child menus appear. Could you please explain what steps I have missed.
THANKS
Don't need superfish module.
You don't need the superfish module because superfish is included with Bartik Plus. If removing it doesn't fix the problem, can you give me a link to your site (is it online)?
disabling superfish didn't change anything
I disabled superfish but nothing changed. I placed 2 pages under the 'home' page of main menu. 'show expanded' is checked for 'home' but not for other 2 although I also tried checking the 'show enabled' for child pages. site is https://www.organicallydone.com/drupal7_new_install/.
I appreciate the help
Is Bartik Plus set as the default theme?
Did you forget to make Bartik Plus the default theme? I've looked at your site, and none of the Bartik Plus resources are being loaded. From the looks of it, Bartik is still your default theme.
Setting to default was all I needed
Sorry for the late response - apparently I do not have my account set up to ping me when I get feedback on a comment.
I am a drupal newbie. I had installed and enabled bartik plus but didn't realize I needed to make it the default theme. Everything worked great after that. thanks for the help
can't get bartik plus to show up in my appearance menu
Hi,
I downloaded and extracted the bartik plus sub theme to my sites
Where do I find Z-index to correct drop down menu overlapping
Thanks for the great subtheme JJ! I'm currently using Bartik Plus and having issues similar to some others above with regard to my drop down menu floating behind my rotating banner slider created with "Views" at the top of my content block. I understand that modifying "z-index" will do the trick, but can't find exactly which file to make the modification.
Thanks.
Solution
Found the alternate solution via modifying the z:index in Bartik Plus "menu_style.css"
Details?
Hi kinetic, I'm a relative newbie as well and I'm not sure exactly what you changed in "menu_style.css". Can you elaborate?
I've got a small flash
I've got a small flash display in a the content region just below the drop down menus and the menus drop behind the flash. I'd greatly appreciate any help. Thanks.
Problem with Bartik Plus and screenreaders.
Hello there,
Firstly thank you for doing the work on this theme. I'm wondering if anyone else out there has tried using this with a screenreader? For those unaware what a screenreader is, it's a piece of software which enables a blind user to access computer resources.
Essentially, I installed the theme, and the menus do appear to be expanded. However, they seem to disappear. So:
I have a site with a link in the main menu called "teaching". This link contains four child-items which are the names of the courses I teach: AB101 CD202 EF303 GH404. Now when I reach the "teaching" link with a screenreader, it tells me that there are four submenu (child) items. However, by the time I've moved off the parent link and read, say the first one, the list seems to close up or, if you will, contract back into the parent item.
So i'm wondering is this actually happening? What's noteworthy the demo of the theme seems to work fine so I'm confused.
Thanks and apologies if this isn't clear. Site isn't online yet but a localhost installation.
Cheers.
Custom header path error
I wanted to tweek the bartik plus color scheme. When I try to modify the colors, I get 'The custom header path is invalid.' on saving. Looked through the theme files but couldn't find the path information.
I appreciate your help.
bartik plus not working
Hi,
I've tried to install bartik plus sub theme with several different methods but it never works(doesnt show up on my appearance page or creates errors when trying to install as new theme.) I downloaded bartik plus and extracted to my sites
If we keep the mouse pointer
If we keep the mouse pointer in the menu their node are displayed down
for that what i want to do
I'm also trying to figure
I'm also trying to figure this out, and surprisingly (or not), there is currently no such thing !
See #1411514: document how to integrate nice_menus with an existing menu for the adventure ...
Bartik Plus
This damn thing does not work as advertised. I enabled the parent menu but child links do not display when hovering.
Simpler is always better.
Theme Developer Breaks Bartik Plus Drop Down Menus
Theme Developer Breaks Bartik Plus Drop Down Menus
Simpler is always better.
Mystery padding 40px in bartik plus
Thanks for this - almost what I was looking for!
Just one detail - I am getting 40px left padding in front of the first main menu item. In Firebug, I can't see what css is producing this. But left justified main menu is what I have in Bartik, and prefer to keepo that.
Any idea where the padding comes from? According to the 'layout view in firebug, it is from the ul tag - but no reference to padding anywhere in the css as far as I can see!
Matthew -- Loving this
Matthew --
Loving this subtheme, but having the same problem:
The first menu tab is now indented.
I know this is old, but did you find the cause?
Thanks!
Bartik Plus menus not visible to Anonymous Users
JJ thank you for the Bartik Plus menus. I have built a wonderful Drop down menu with three levels. This menu finally links to a page created by the views module. This page is a table of pigeon racing results setup to manage sorting, result viewing etc. I have done the obvious things, enable and show as expanded. Its works and looks great when I am logged in as 'admin' but not visible to anonymous or authenticated user.
Do you have any suggestions as to what might be my problem.
I have tried Superfish and Nice Menus and get the same result. (not visible to anon and auth)
Is it the fact that I have linked to a page and not a node?
I am a newby with Drupal
Take care
Adam
JJ thank you for the Bartik
JJ thank you for the Bartik Plus menus. I have built a wonderful Drop down menu with three levels. This menu finally links to a page created by the views module. This page is a table of pigeon racing results setup to manage sorting, result viewing etc. I have done the obvious things, enable and show as expanded. Its works and looks great when I am logged in as 'admin' but not visible to anonymous or authenticated user.
Do you have any suggestions as to what might be my problem.
I have tried Superfish and Nice Menus and get the same result. (not visible to anon and auth)
Is it the fact that I have linked to a page and not a node?
I am a newby with Drupal
Take care
Adam
Link to website?
Hi Adam,
Sorry I'm late in getting back to you. Are you still working on this? If so, please send me an e-mail and I'll try to help.
Email
Good afternoon JJ,
I am still struggling, so please help. What is your email.
Adam
Bartik Plus new issues - ISSUE RESOLVED
John,
Not sure how to delete comment - I realized that I have been using Noggin for header picture and that the issue is probably related to that module since it was one that I have just upgraded...
A module-free approach
I've figured out a way to add drop down menus to Bartik (Drupal 7) by creating a sub-theme, adding a couple of theme functions and some CSS and it seems to work well. I've documented it here.
For others drop down menu not showing on hover
Had to read through this whole discussion to find this.... x.x woulda saved me a couple hours of experimenting lol..
" Every parent item that has children must have "SHOW AS EXPANDED" checked on its edit page."
Main Manu drop downs are not
Main Manu drop downs are not supported in drupal.
I have searched High and low for a way to make Bartik in D7 have main menu drop downs and still be "Out of the box" upgradable.
This official post should help others also looking to make drop downs with an explanation on Bartik menus
http://drupal.org/node/1508652
Thanks for Bartik Plus
Thanls very much for this .. very helpful indeed!
Bartik Plus creates right shift of primary links
First of all, thanks to JJwhitney for Bartik plus!!
Not sure why, but after I installed Bartik plus, the dropdowns work nicely. The 1st primary menu link however is shifted over right about 40px. I have to use CSS for the #main-menu-links to fix it.
Any thoughts?
It looks like it's caused by
It looks like it's caused by -webkit-padding-start: 40px
It should be fixed with this line of CSS:
.menu.clearfix.sf-js-enabled { -webkit-padding-start: 0px; }
Bartik drop down menu
I have put horizontal drop down menu in my site with this tutorial drupal.org/node/1508652 :) Is very easy.
Thank you!
Thank you JJW for Bartik Plus
Thank you JJW for Bartik Plus. It is a great solution. I have been using it flawlessly for 6 or 7 months now. However I have recently updated Drupal Core (7.28) and Responsive Bartik theme. Now the sub menus will not drop down.
I have sub themes as follows:
The default theme is Responsive Bartik . This structure has worked fine until the updates. Hoping you may have the answer.