vertical menus and 'this' context

Feed 4 posts, 2 voices

Aug 18, 2008 15:24
Avatar
21 posts

Hello, I'm trying to dispaly vertical menus splitted in two parts (left and right sidebar)

So the foreach() in the header standard snippet won't work and I need a function called menu_entry to display properly (and by hand) then entries (subpages)

I get something like this

  • left sidebar

-- echo menu_entry('subpage1_slug'); -- echo menu_entry('subpage2_slug');

  • right sidebar

-- echo menu_entry('subpage3_slug'); -- echo menu_entry('subpage4_slug');

and subpages inherit main page layout.

But I noticed a problem : $this !

in the context of the sidebar, it refers the main page, but not subpages !

so I can't use it to find subpages, slug, title, url and determine which page is currently browed...

if I put the function in a snippet, it's worst : I get a fatal error because of this context is lost (since I try making a 'closure' writing $thisPage = $this before function call...)

How could I proceed ?

I think the answer is in 'CSS play' demo but I'm not sure

 
Aug 18, 2008 18:38
Avatar
21 posts

doing a detour, it works ! code comes sooner

 
Aug 19, 2008 04:19
Avatar
820 posts

Glad you have a solution! I'm still not 100% clear on what it is you are trying to do!! O_o

 
Aug 19, 2008 15:12
Avatar
21 posts

the snippet is in my temp dir

www.eozine.fr/temp

 
Aug 19, 2008 15:14
Avatar
21 posts

sorry David no visible example for the moment. Site will be changed sooner

  • I think code speaks itself !