Orkun Posted October 27, 2020 Share Posted October 27, 2020 Hi Guys I am trying to output a warning message in the admin to the user if he unpublishes a page which has children pages. This is the code I have inside my autoload sitehelper module. $this->addHookBefore('Pages::unpublishReady', $this, 'notifyOnUnpublish'); public function notifyOnUnpublish(HookEvent $event) { $pages = $event->object; $page = $event->arguments(0); if($page->numChildren > 0) { $this->warning("You have unpublished a page which contains sub-pages. You need to move these sub-pages or unpublished them."); } } It works when I am on Page Edit Screen. But how can I make something like this work for the Pagetree Actions with ajax refreshing? KR Orkun Link to comment Share on other sites More sharing options...
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