processwire/processwire-requests

Find pages by Publish status (published|unpublished) using Lister / ListerPro

Closed this issue · 4 comments

klor commented

Short description of the enhancement

As an editor working with published / unpublished pages, I want to find unpublished pages (as well as published pages) using Find so that I can easily identify unpublished pages that I'm working on and need to finalize so they can be published. Currently, it seems I can Find pages by Published Date.

Optional: Steps that explain the enhancement

  1. Go to Find at /processwire/page/lister/
  2. "What pages to show:" (I can only choose Published date - Lister has a "Published" filter but only allows specifying a date).

Why would the enhancement be useful to users?

  • Being able to Find unpublished stuff is nice.

Optional: Screenshots/Links that demonstrate the enhancement

image

Version:

  • Installation 1: ProcessWire 3.0.200, Lister v0.2.6 β
  • Installation 2: ProcessWire 3.0.200, ListerPro v1.1.3 β

Try this:

$this->wire()->addHookBefore('ProcessPageLister::getSelector', function($event) {
    $event->object->allowIncludeAll = true;
});

together with this in the Lister config to allow hidden and unpublished.
image

klor commented

@ryancramerdesign - Of course.. :-)
@adrianbj - That's a handy code snippet that I'll keep in mind.
Thank you, Ryan and Adrian for your fast, competent, and friendly support as always..

@klor - IIRC, that hook is necessary if you're trying to make this available to non-superusers because they just can't use the status = unpublished option.