Jump to:
| Project: | footermap: a footer site map |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | mradcliffe |
| Status: | closed (fixed) |
Issue Summary
Thanks for this handy module.
I would like to show only the top level (level 1 only - not showing any child nodes)of navigation on only the Primary Links menu.
When I recurse zero, I can turn off children, but I cannot prevent the Secondary Links from showing.
Is there a way to either tag those uniquely, so I can use CSS to hide them, or to prevent the footer from generating them in the first place?
I thought setting topmenu to 1 and recurse to 0 might do the trick, but it does not....
This is a related issue to if I wanted to use the nicemenus module. If I do that, then neither of my menus will be called by the default drupal names of Navigation, Primary Links or Secondary Links menus. The main (and only nav I want to recurse and put in the footer) will be called nice-menu-1. How can I get to that menu, and not the others, using the settings you have? Is there a way to do that?
I looked at your source, but do not understand enough php to try to hard code my way around this....
Comments
#1
This is a good feature to add. I am thinking of the best implementation for this.
I could use a sql comparison function such as IN(), which works in both postgresql and mysql, to compare menu_name with an array from the settings page. However I found that _db_query_callback will always escape strings. This would require a hack to drupal core (or wait until 7). I would prefer to do it in the sql query instead of making the comparison outside of it for mysql databases.
The problem with the above is it may not be implemented in drupal core if i submit a patch.
The other method is to compare outside of sql, which may end up being slower (or not). I'll first make a release with this method, and then change to the latter.
#2
Thanks for the reply. Not being a coder, I did not understand a word of what you wrote :) so I cannot offer to assist...but it is cool that you agree that the idea has merit.
I look forward to seeing what can be done....thx
#3
Please test the latest development snapshot. Tell me if it acts too slow or not.
#4
This seems to work just fine, I do not notice that it is slow.
It does, however have one tiny flaw. It does not filter out unpublished nodes.
Aside from that, I think it is great!
THANK YOU!
#5
Hmm, you're right about the unpublished nodes bit. Footermap only looks at what's in menu items. It would be extra work to unpublish a node AND disable the menu item. This is a good feature to add, and I have added it. This should work with either MySQL or PostgreSQL. I'm going to release a new official release with the changes.
As for the slowness. I'm going to do further testing with the Drupal core modifications I'm thinking of submitting, and if it is accepted or necessary then we'll go that route in future versions. That is fairly long term.
#6
I have added caching support to the footermap development branch. This should speed things up considerably.
#7