Is there a way to add another custom css class into the module? I want to style child links to go under their primary links
beckyjohnson - June 3, 2009 - 04:46
| Project: | footermap: a footer site map |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | mradcliffe |
| Status: | active |
Jump to:
Description
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
| Attachment | Size |
|---|---|
| Picture 12.png | 30.94 KB |

#1
There 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.
#2
Awesome! That's great. Thanks.
Becky
#3
First 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
#4
Hi Stirfry,
Could you produce a patch of your modifications or just post your modified version of the module here please?
Thanks,
John
#5
I 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.