bernhard Posted May 24, 2015 Posted May 24, 2015 hi all, i managed to hook ProcessPageList::find to return the right set of pages but i don't know to set "showRootPage" to false via hook if i set this line to "false" it works as expected, but i want to set this based on the role of the logged in user and of course i don't want to hack the core: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessPageList/ProcessPageList.module#L61 I'm making my first steps how to hook into methods but i don't know how to set properties of the class via hook in general? thanks for your help!
tpr Posted August 24, 2016 Posted August 24, 2016 In ProcessPageList::find you can set showRootPage to false like this (trial and error): $event->object->set('showRootPage', false); // or this: // $event->object->showRootPage = false; 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now