[wp-trac] [WordPress Trac] #4351: Modify Walker_Page to add current_page_tree class for some style

WordPress Trac wp-trac at lists.automattic.com
Mon May 28 15:32:46 GMT 2007


#4351: Modify Walker_Page to add current_page_tree class for some style
-------------------------+--------------------------------------------------
 Reporter:  ev3rywh3re   |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  2.3      
Component:  Template     |     Version:  2.3      
 Severity:  normal       |    Keywords:           
-------------------------+--------------------------------------------------
 I thought this might be a useful suggestion since CSS has no "parent"
 selector.

 Basically just a slight mod to class Walker_Page that "should" identify
 the current page location and depth and add a current_page_tree class to
 the preceding UL. There may be a better implementation, and I did play
 with adding class levels to the UL(s), but I thought I would keep this
 simple as a starting point for this ticket.

 Here is a sample CSS that seems to work with the attached patch to produce
 CSS based collapsable lists

 {{{
 div.sidebar li.page_item ul {
         display: none;
 }

 div.sidebar li.current_page_item ul {
         display: block;
 }


 div.sidebar li.current_page_parent ul {
         display: block;
 }

 div.sidebar li.page_item ul.current_page_tree {
         display: block;
 }

 div.sidebar li.page_item ul.current_page_tree ul {
         display: block;
 }
 }}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4351>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list