I'm trying to make a footer site map at my site like the attached screenshot. I noticed thought that if I make a parent node and then make nodes that are children in terms of menu structure, the children show up like this:
parent link child link 1 child link 2 child link 3
But I want them to look like my mockup which is attached and I was thinking that if i could give child links a special class, then i could style them to show up how I want. Is this possible?
Becky
| Comment | File | Size | Author |
|---|---|---|---|
| Picture 12.png | 30.94 KB | beckyjohnson |
Comments
Comment #1
mradcliffeThere is not a way to do this currently. I am using theme_links to render the links as a list, which does not provide a way to insert custom classes into list items.
However, I think this is a good idea. I will need to implement my own theme function to do this.
Comment #2
beckyjohnson commentedAwesome! That's great. Thanks.
Becky
Comment #3
Stirfry commentedFirst of all thanks for making this module.
A couple of customisations I added for this module were a class called 'home' for a link that matches the front page, as I wanted to style this differently from the rest of the links.
Also I assigned the menu items a class based on their level. Obviously, this may not be desirable in some cases where there are many levels in the menu, but for my particular site there is only ever a parent/child relationship, so maybe these types of classes would come in useful for others in the future.
Great module though man
Comment #4
johngriffin commentedHi Stirfry,
Could you produce a patch of your modifications or just post your modified version of the module here please?
Thanks,
John
Comment #5
brightboldI wanted to do exactly the same thing, so I agree it would be really useful to have a class for each item indicating the level so they could be styled accordingly, or to have them in nested unordered lists, so you could style the first level with <li>, the second with <li> <li>, etc.
But in the meantime I have discovered a workaround, although it will not work in all cases. Every top-level item in the list that follows one or more child items gets the class "first". (I have not tested this with a menu more than two levels deep, so I can't speak to what happens with deeper levels.) So if all top-level items in your sitemap have at least one child you can use the "first" class Unfortunately, if an item has no children then the subsequent parent item will not get the .first class and will appear as if it's a child of the previous item.
I was able to use .first to style my sitemap as desired. But in Becky's case, "Members" has no children so "Developer Tools" and its children would look like children of Members. "About 4G Developers" should work fine though, since it's the last item in the list.
Comment #6
jackread commentedyeah would be nice to have child links as nested < ul > 's
e.g.
< ul >
< li >home< /li>
< li > about < /li >
< ul >
< li >mission statement< /li >
< li >meet the team< /li >
< / ul >
< / ul >
Comment #7
TheDoctor commented+1 for #6. Subscribing.
Comment #8
kuydigital commentedAny progress with this?
Comment #9
mradcliffe#637734: Footermap Theming: The Next Step
Comment #10
truyenle commentedLooking for the same thing and couldn't get it through footermap, so I have to follow http://drupal.org/node/358426#comment-2352964 to use menu_block to achieve the same thing. Work like charm.