Hi guys
When using the custom menu what do I need to add or modify to enable the selected/active item in the menu to keep its link?
I had a look in the printCustomMenu function but cannot work out where I need to add the necessary code (to build my own custom function) to keep the link for things like the main news page or the selected album etc
Please help
Thanks
GW
Comments
If you just want to add things to the menu, you do that via the add item tab. You can make a menu item which invokes a function as one of the options if that is what you are getting at. Of course, there are specific selections to make a menu item for things like the main news page.
I am using the Custom menu option and I am building a menu, one of the menu items is the 'zenpagenewsindex' which then provides me with a menu item to go to the News index page, great. However when I go to that page via that link it brings the page up but the menu item is no longer linked, it has a class of 'menu_zenpagenewsindex' and no active or inactive call. How can I retain the link around the menu item even if it is selected?
The same thing happens when I have an 'album' menu item as well.
Thanks
GW
Thanks
GW
Hey, that was un-called for and not necessary.
Nothing to do with ignorance at all. Why does wanting to keep the link there ignorance?
I simply asked a question to fit my situation and that was it. There are many questions raised on these forums that you might not agree with what is being asked for and hence why they are not default in ZP, but they are still asked, are you always this way to everyone?.
Also yes I found the printCustomMenu function as I said in my original post, I just could not find what to edit to make it work as 'I' wanted it to.
But it would seem I am not going to get any help by your response.
Thanks
GW
With that being said, I agree with you on this one. I will attempt to argue the case without pissing off the developers...(wish me luck )
When styling an unordered list as a menu, it is much more common place, and easier to style a tag inside of the li. whether it be a span or anchor, or both. It is very difficult to style the "active" link when it is just text inside a li. It forces you to apply css rules directly to the li, which will then affect all the li in the list.
I have many of times, made custom functions just in order to add a anchor tag or span tag inside of the list items for ease or even ability of styling.
My two cents -
You are precisely right in that the text within the 'li' tags does need to have something that can be styled, hence why I have asked for the link to remain as at least then I can style the 'a' tag within the 'li' elements of the menus, if there was a span in there then that would have been sufficient.
As for specific code I have made a copy of the printCustomMenu and renamed it in the themes functions.php file and then ensured that this new name is being called, I just don;t know where or what to edit within that to achieve what I have asked for.
I can't provide a link yet as it is not yet online, it is on my development box next to me until the site is done.
Thanks
GW
Having said that this is not the ideal solution, surely as gjr has said just add a span around the default menu items and all would be good for anyone to use and style as they wish, this includes the custom menu items.
Thanks
GW
If any standard function we did for a reason explained does not fit your needs and we don't agree just do your own.
It is very well possible to style the `` directly without affecting the `` with anchors or else. There are also css classes for the different menu items attached that let you differ between certain item types.
However, I often write my own menu functions as well if I have a site with a fixed menü requirement. Easier for the client (and me) as he can't "mess" around with it...;-)
Having said that I did feel that it was out of character for the ZP developers as a whole, and it has tarnished my ... what do you call it... i don't know.. impressions, no not the right word..., anyway does not matter now as I have sorted it out by writing my own menu similar to what you suggested and that works for me at this stage.
As for being able to style the li item, sorry it is too clumsy and not an effective way to manage styles of menu items, there needs to be an internal element to the li tags to enable this to function more effectively i.e. add a span around the text.
thanks
GW
Sorry, I don't agree with the span. `li.someclass` vs `li.someclass > a` I find not really that clumsy.
Anyway, just as you did special needs might require special custom solutions. Maybe we just don't understand exactly what you are doing. Try to convince and maybe show your site later.
Cheers
GW
The differences;
what we have now
li > text
li > a.class > text
what is being suggested
li > span.class > text
li > span.class > a.class > text
is that clearer?
Thanks
GW
`
- html element
- A new page
- gps
- test
- test4-2
`Just what is missing there? There are pleanty of classes to trigger from. There is absolutly no need for spurrious span tags.
GW
That would be reasonable to have a span element I guess.
Cheers
GW