[wp-trac] [WordPress Trac] #5662: Class Ancestor Pages
WordPress Trac
wp-trac at lists.automattic.com
Mon Jan 14 04:28:45 GMT 2008
#5662: Class Ancestor Pages
---------------------------+------------------------------------------------
Reporter: AaronCampbell | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone: 2.5
Component: General | Version:
Severity: normal | Keywords:
---------------------------+------------------------------------------------
The purpose is to add a class to ancestor pages. Right now, a CSS class
is added to the current page (current_page_item), and it's parent
(current_page_parent). I created a plugin ([http://xavisys.com/wordpress-
mark-parent-pages-plugin/ Mark Parent Pages Plugin]) that uses the DOM to
travel farther upstream, and tag all ancestor pages with a class as well
(current_page_ancestor). Upon submitting the plugin to the plugin
repository, I was told to "''Please make this a core patch on Trac.''" So
here it is. I haven't actually made the patch yet, but I'll try to when I
get time. If someone else has time, please feel free. It seems like it
should work just like the plugin.
The only real question is whether the parent should get tagged as an
ancestor as well (with both classes). The plugin does, because it's
purpose was to give me collapsing menus, and doing so made my css simpler:
#nav ul li.current_page_item ul,
#nav ul li.current_page_ancestor ul {
display:block;
}
#nav ul li.current_page_item ul ul {
display:none;
}
instead of
#nav ul li.current_page_item ul,
#nav ul li.current_page_parent ul,
#nav ul li.current_page_ancestor ul {
display:block;
}
#nav ul li.current_page_item ul ul {
display:none;
}
--
Ticket URL: <http://trac.wordpress.org/ticket/5662>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list