Page List - Include password controlled pages in public page list

Permalink
I am trying to get a Page List to show 'Featured' pages that are login/password protected when viewed as a guest.

Does anyone have any suggestions please?

dclmedia
 
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi dclmedia,

It looks like this can be done with the ignorePermissions() method.
http://documentation.concrete5.org/api/class-Concrete.Core.Page.Pag...

In the Page List block controller, I added ignorePermissions() after the new PageList() object is created in on_start():
public function on_start()
{
    $this->list = new PageList();
    $this->list->ignorePermissions();
    $this->list->disableAutomaticSorting();
    // the rest of the code

https://github.com/concrete5/concrete5/blob/develop/web/concrete/blo...

Since the Page List view.php $pages array is already "filled" with pages (this is done in the controller), I am not sure how this can be done outside of forking the Page List block.

If someone else has a block template solution to handle this, I would be very interested to see how it was done.
dclmedia replied on at Permalink Reply
dclmedia
Perfect! That has worked a treat. MrKDilkington you are truly a font of all knowledge.