[wp-hackers] current_page_ancestor class lost on Tertiary pages?
Louis McCoy
louie at louiemccoy.com
Wed Sep 15 17:47:37 UTC 2010
I hadn't tried building a custom walker function, but adding some detailed
CSS and just manually adding all of the pages into the Menu from the admin
menu I think will take less time, so that's what I'm doing. Even if it will
look a bit odd on the back-end. In the past I'd defined my own globals based
on the URL - i.e. url.com/foo/bar/X2 would return in $segments = array([0]
=> 'url.com', [1] => 'foo', [2] => 'bar', [3] => 'X2') - so I used that for
both highlighting and breadcrumbs as necessary. The new menu system just
seemed all kinds of exciting, so I dove right in :-)
Thanks for all the insight, everyone!
-L
On Wed, Sep 15, 2010 at 1:30 PM, Patrik Bóna <patrik.bona at mrhead.sk> wrote:
> And that is one of the reasons why i don't like new menu system so much ;).
>
> Btw. did you try to use custom walker function for generating menu ? Maybe
> you can "fix" it this way. (I am not sure, maybe i am totally wrong ;)
>
> Patrik
>
>
> On 09/14/2010 11:22 PM, Louis McCoy wrote:
>
>> That's what I was afraid of.
>>
>> The question, then, would be why have both current_page_ancestor and
>> current-menu-ancestor if it isn't looking at the page hierarchy anyway?
>> Seems redundant to me...
>>
>> On Tue, Sep 14, 2010 at 5:11 PM, Dan Smart<dan at dansmart.co.uk> wrote:
>>
>>
>>
>>> The issue you have is that the menu doesn't look at the page hierarchy,
>>> only the menu hierarchy. So you need to add X1 to X22 to the menu, then
>>> the
>>> correct classes will appear.
>>>
>>> Dan
>>>
>>> Dan Smart - Web Developer
>>> www.dansmart.co.uk
>>>
>>> On 14 Sep 2010, at 20:31, Louis McCoy<louie at louiemccoy.com> wrote:
>>>
>>>
>>>
>>>> How deep are these levels? Can you be more specific about the overall
>>>>> menu structure or link to an actual example?
>>>>>
>>>>>
>>>> It's just the third level - I should have been more clear; it's not the
>>>>
>>>>
>>> menu
>>>
>>>
>>>> that is three levels deep, it's the page structure. So, this is the page
>>>> structure:
>>>> I. Foo
>>>> A. Bar
>>>> 1. X1
>>>> 2. X2
>>>> ...
>>>> 22. X22
>>>> B. Saloon
>>>> C. Tavern
>>>> II. Foo Fighers
>>>> III. More Foo
>>>>
>>>> But this is the menu structure, since the menu by design doesn't go
>>>>
>>>>
>>> deeper
>>>
>>>
>>>> than two levels:
>>>> I. Foo
>>>> A. Bar
>>>> B. Saloon
>>>> C. Tavern
>>>> II. Foo Fighters
>>>> II. More Foo
>>>>
>>>> BUT, once I get to X1 / X22 etc. Foo loses the current_page_ancestor
>>>>
>>>>
>>> class.
>>>
>>>
>>>> Is this just because they're not a part of the menu structure? Shouldn't
>>>> Foo, being an ancestor of X1, still keep the current_page_ancestor
>>>> class,
>>>> even if X1 isn't in the menu structure?
>>>>
>>>> Hope I was clearer this time... :-)
>>>>
>>>> -L
>>>> _______________________________________________
>>>> wp-hackers mailing list
>>>> wp-hackers at lists.automattic.com
>>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>>
>>>>
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>
>>>
>>>
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
>>
>>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list