-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Short description of the enhancement
It would be useful to have more opportunities to manipulate ProcessPageList, to allow for situations where you are limiting the items that appear in the tree or want greater control over what branches are open when ProcessPageList loads.
Two specific requests:
1. An easier way to manipulate the count number of children for a PPL item:
I regularly have situations where I need to prevent certain pages from appearing in PPL for particular roles, and I do this by hooking Page::Listable
. This works well, but then the child count on the parent page in the list becomes incorrect.
When a branch is AJAX-loaded it is possible (although rather awkward) to hook ProcessPageList::execute
and manipulate the JSON to correct the child count. But when some branches are shown in an open state when PPL loads (i.e. the branch is not AJAX-loaded) it is very difficult to manipulate the child count.
2. A way to tell PPL to load with multiple branches open.
As far as I know there are two things currently that control which braches are open when PPL renders:
A. There is the open
GET variable. When this is present a single branch will be rendered open. This option has a nice feature where parents of the page that has its ID supplied in the open
variable are also rendered open, so the user doesn't have to work out the parent IDs and supply those also. However, there is an issue when using open
with the ID of a page that has many siblings and the page does not occur within the first pagination of siblings in PPL. In this case PPL does not open correctly to show the page (if this is considered a bug I can file a separate issue to keep track of it).
This option is easy to use to open a particular branch of PPL, but the downside is that it isn't possible to pass multiple IDs to open multiple branches.
B. There is the pagelist_open
cookie. This "remembers" the last state of PPL and allows multiple branches to render open, and it also supports pagination for large numbers of siblings because the start value of the pagination is used.
The downside to this is that it isn't practical to manipulate this cookie to control which branches render open. If you hook ProcessPageList::execute
and write some custom data to the cookie it doesn't take effect for that execution of PPL, only for the next execution.
What would be great would be some new hookable method (or possibly a new GET variable) where multiple IDs could be be supplied, and it would be extra nice if PPL could work out the parents and the correct pagination for those IDs so those don't have to be supplied.
Thanks for considering these requests.