Closed (fixed)
Project:
Dynamic Persistent Menu
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
5 Oct 2009 at 19:49 UTC
Updated:
26 Mar 2010 at 19:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
Adam S commentedI have some css here that might help. Just put http://thechefsgalley.com/sites/all/themes/openpublish/ before the .png links if you want to look the images. Basically I created a 46px high box and dropped the sub menu 14px. I'm working on it. Would like some way to have the parent to an active submenu to be active too. Let me know what you think. If your using a 960 framework I image it would just slip right in.
Comment #2
castawaybcn commentedthanks for your input adam, it definitely is something but sadly enough I cannot make it work on the site I am building.
My knowledge of css is quite limited (I am actually learning on my own as I develop the site), but it seems to me you are not using the menu within a block, am I right?
Also, are you using your navigation menu? I am using a custom one instead, but even when I changed it to the navigation menu it did nothing. The images were not loaded in any case, and I did get no path errors in the reports either. Should I change your strings
#navigation_menuto
#my-custom-menu_menuto make it apply to my menu?
UPDATE:
I managed to avoid the annoying vertical movement with the trick shown in http://drupal.org/node/246655 by adding this to my css (still no luck with theming the menu links though):
Comment #3
Adam S commentedSorry, I forgot that I changed the page.tpl.php file to ad the #navigation selector. Are you using Firefox with the Firebug add on? Here is the code. I went to http://thechefsgalley.com/sites/all/themes/openpublish/images/nav-shadow... and there was a tiny image all the way in the top left. Do you see that it is only a tiny image that is repeated the length of the menu?
Comment #4
castawaybcn commentedno worries, I was playing around and got most of it working. What I am struggling with at the moment is changing the looks of:
- main menu links without submenus do not show as active when the page they point to is active
- if a submenu item is visited, its parent is not shown as active
Here's the code I am using. Background images, which do not change, are actually in the header background image:
I am attaching a few images showing the current behaviour (my site is not quite visible yet, sorry). You can see the current page title in the middle left hand side of the image, the title of the picture also tries to describe the behaviour.
Any ideas why the items in pictures 03xxx and 04xxx are not highlighted?
Thanks a lot for your help!
PS I am actually using Firebug, but I must admit I am a bit overwhelmed by the sheer amount of information it provides ;)
Comment #5
Adam S commentedThe active menu item uses the class .active. You can use that to theme your active top menu. I don't think that you can have both the sub menu and the parent menu as active at the same time, which would be cool. Hopefully someone will code the logic to get that done soon. I wish I knew how.
Comment #6
castawaybcn commentedStrange. In the example provided for the module you can see the exact behaviour I was writing about. See:
http://www.e-joussour.net/en/category/7/156/171 where both submenu and parent are active, unlike in my 03_xx picture
and
http://www.e-joussour.net/en/category/7/194 where top menu (without submenus) is active, just what I would like to happen in my 04_xx picture). Am I using the .active class wrong here? should it be a:active instead?
It feels better that this is not such a simple issue to deal with, though, I will keep on trying and let you know if I find anything. In the meantime any feedback which may cast some light on the matter is much welcome.
PS
when I manage to get this working I will write a short howto/documentation with a list of the css classes and the items they affect for this fantastic menu.
Comment #7
Adam S commentedYour very determined. Thanks for sharing that site. It gives me some ideas. What needs to happen is when the menu is being formed on the server the information is being passed through a theme function. The theme function adds that expanded class to the top menu if one of the children are active. I wonder how to write the logic if a primary menu item is active and it has parent then theme the parent with a class of expanded. I'm looking at those classes on the page..... I think they look familiar. I found them. See the class. If $menu is true then $class = expanded. If $menu is false and $has_children is true then $class = 'collapsed or $menu is false and $has_children is false then $class = 'leaf'. This must be the way that the navigation menu in Garland is formed. Someone might be able to whip up some template.php code to add the class to active menu items so that dpm works.
Sorry about my ramblings.
Comment #8
castawaybcn commentedYep, but do let me know if I am getting a bit of a pain... I am perfectly aware that this issue has derived far far away from its original point, which is, btw, already solved. Perhaps I should start a new issue and mark this one as closed. But I am not familiar with the issue tracking system and would rather let the maintainer choose what to do with this.
I deserve no credit for this, thank the module's author instead as this is the official demonstration for dpm.
Your ramblings are most welcome, and make a lot of sense to me. If only I had the skills to turn that into php code... I tried yours instead (added it to the end of my theme's template.php), but nothing changed at all.
I also checked the template.php file in garland and could not find any references to the trail class at all.
Thanks a million for your time and patiente, adam. And do let me know if this has already gone too far and you do not wish to waste any morer time on it. No offence will be taken.
Comment #9
Branjawn commentedgive the block (e.g. block-dynamic_persistent_menu-0) a height.
Comment #10
yrocq commentedBranjawn has the right answer. I set this issue as fixed. Don't hesitate to reopen it if it doesn't work.
Comment #11
yrocq commentedComment #12
castawaybcn commentedit does, thanks a lot Branjawn!!