custom Edit Pages screens

View: New views
8 Messages — Rating Filter:   Alert me  

custom Edit Pages screens

by Steve Taylor-15 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm working with a site with a lot of pages, some sectioned off into
distinct areas. It's becoming unmanageable to work with a specific
section, tabbing to the right page of the Edit Pages list all the time
- and it'd be unmanageable in a different way if I increased or
removed the pages-per-screen limit.

I thought it'd be good to add some custom Edit Pages screens to the
Pages menu in admin, each one only showing descendents of particular
pages that are the parents for separate sections of the site.

After looking into edit-pages.php for a while, I can't see an obvious
way to use this code (hooks, includes, whatever). I'm heading towards
copying it wholesale and tweaking. Anyone got a better idea?

thanks,

Steve Taylor
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: custom Edit Pages screens

by scribu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can add a ?page_parent=124 and then hook into 'pre_get_posts' and add
that as a query_var.

The only roadblock is displaying the filter links. You'll probably have to
use JS for that.


--
http://scribu.net
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: custom Edit Pages screens

by Jeremy Clarke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Nov 7, 2009 at 4:11 PM, Steve Taylor <steve@...> wrote:
> After looking into edit-pages.php for a while, I can't see an obvious
> way to use this code (hooks, includes, whatever). I'm heading towards
> copying it wholesale and tweaking. Anyone got a better idea?

I have to recommend the Pagemash plugin:
http://wordpress.org/extend/plugins/pagemash/

It might not be the best solution for your particular situation since
it puts all pages on one screen, but if your browser can handle it its
incredibly powerful. IMHO its 'the missing page management tool' for
people who have a complex hierarchy, and if it ever breaks you're not
really any worse off than before, it just gives you a better way to
control things than Pages > Edit.

--
Jeremy Clarke | http://jeremyclarke.org
Code and Design | http://globalvoicesonline.org
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: custom Edit Pages screens

by Steve Taylor-15 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Jeremy, the pageMash plugin is fantastic. Definitely a fine
replacement for My Page Order.

However, as you say, it's probably not ideal for me. The whole idea is
to be able to go to a list that only deals with a certain page's
descendents. pageMash makes it a little easier than WP's pagination,
but I assume it'll slow down when there's a lot of pages.

scribu, thanks for the tip - I'm experimenting now. So far the major
issue is that adding post_parent as a query_var returns *only*
immediate children of that page - and none of the other descendents.
Any ideas? I can't see an obvious query_var to set. I imagine the
get_pages() parameters are irrelevent here?

Steve


2009/11/8 Jeremy Clarke <jer@...>:

> On Sat, Nov 7, 2009 at 4:11 PM, Steve Taylor <steve@...> wrote:
>> After looking into edit-pages.php for a while, I can't see an obvious
>> way to use this code (hooks, includes, whatever). I'm heading towards
>> copying it wholesale and tweaking. Anyone got a better idea?
>
> I have to recommend the Pagemash plugin:
> http://wordpress.org/extend/plugins/pagemash/
>
> It might not be the best solution for your particular situation since
> it puts all pages on one screen, but if your browser can handle it its
> incredibly powerful. IMHO its 'the missing page management tool' for
> people who have a complex hierarchy, and if it ever breaks you're not
> really any worse off than before, it just gives you a better way to
> control things than Pages > Edit.
>
> --
> Jeremy Clarke | http://jeremyclarke.org
> Code and Design | http://globalvoicesonline.org
> _______________________________________________
> wp-hackers mailing list
> wp-hackers@...
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: custom Edit Pages screens

by scribu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 9, 2009 at 1:53 AM, Steve Taylor <steve@...> wrote:

> scribu, thanks for the tip - I'm experimenting now. So far the major
> issue is that adding post_parent as a query_var returns *only*
> immediate children of that page - and none of the other descendents.
> Any ideas? I can't see an obvious query_var to set. I imagine the
> get_pages() parameters are irrelevent here?
>

You could manually get all the child page IDs and put them as 'post__in'.


--
http://scribu.net
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: custom Edit Pages screens

by Steve Taylor-15 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> You could manually get all the child page IDs and put them as 'post__in'.

That works! Wasn't familiar with these under-the-hood paramters for a
query that aren't exposed by get_pages() etc.

Only problem left is the annoying bold "Parent Page: ..." markers that
are output. I've been trying in vain to hide them with CSS, but
selecting inner text but not child elements seems impossible. This is
the markup:

<strong><a title="Edit [page title]" href="[edit link]"
class="row-title">— — [page title]</a> | Parent Page: [parent
title]</strong>

I tried:

table.page td.page-title strong { display: none; }
table.page td.page-title strong a { display: inline !important; }

But no luck. This kind of works:

table.page td.page-title strong { visibility: hidden; }
table.page td.page-title strong a { visibility: visible !important; }

But obviously there's random blank space everywhere.

Well, it probably would have taken less time by now to build my own
page from the ground up. Ah well! I have to leave this for now...
Thanks for the hints.

Steve
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: custom Edit Pages screens

by Charles K. Clarkson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Steve Taylor wrote:
> Only problem left is the annoying bold "Parent Page: ..." markers that
> are output. I've been trying in vain to hide them with CSS, but
> selecting inner text but not child elements seems impossible. This is
> the markup:
>
> <strong><a title="Edit [page title]" href="[edit link]"
> class="row-title">— — [page title]</a> | Parent Page: [parent
> title]</strong>

jQuery is CSS 3 compliant and has functions to target inner text and html.



HTH,

Charles Clarkson
--
Mobile Home Investor
Free Market Advocate
Programmer

I'm not really a smart person. I just play one on the Internet.

Stephenville, TX
http://www.clarksonenergyhomes.com/wordpress/about/
http://twitter.com/CharlesClarkson
+1 (254) 968-8328

_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

Re: custom Edit Pages screens

by Steve Taylor-15 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks. I was trying to stick with pure CSS to avoid the lag you
sometimes get altering CSS with JS. It might be the only option...

But out of curiosity, what are the CSS 3 selectors for this? I can't
find much out there to see if there's any browser support.

Steve

2009/11/9 Charles K. Clarkson <cclarkson@...>:

> Steve Taylor wrote:
>>
>> Only problem left is the annoying bold "Parent Page: ..." markers that
>> are output. I've been trying in vain to hide them with CSS, but
>> selecting inner text but not child elements seems impossible. This is
>> the markup:
>>
>> <strong><a title="Edit [page title]" href="[edit link]"
>> class="row-title">— — [page title]</a> | Parent Page: [parent
>> title]</strong>
>
> jQuery is CSS 3 compliant and has functions to target inner text and html.
>
>
>
> HTH,
>
> Charles Clarkson
> --
> Mobile Home Investor
> Free Market Advocate
> Programmer
>
> I'm not really a smart person. I just play one on the Internet.
>
> Stephenville, TX
> http://www.clarksonenergyhomes.com/wordpress/about/
> http://twitter.com/CharlesClarkson
> +1 (254) 968-8328
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers@...
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers