Is there a way to change the visibility of a page circumventing the dialog/modal (see screenshot) which is asking to change either the order OR the visibility? I’d like to try to implement a small toggle switch to JUST change the visibility (see screenshot).
Of course it’s possible to add a simple checkbox-field and ask for it’s status, but then the drag and drop-function on the subpages-page doesn’t work anymore – because it obviously changes the status but not the hypothetical checkbox-field.
I’m trying to implement a Publish/Unpublish-toggle switch instead of using the sidebar-Status-toggle switch so that the modal window isn’t being triggered. Do you think that’s possible?
I read the docs but could you nevertheless maybe point me in the right direction, scripting-wise? That would be really appreciated!
Thanks for your help!
Maybe you could have a look at some example custom fields here:
Your field would have to call a route that takes on the job of making the page visible.
The method to make a page visible is $page->sort(). To get the correct number to append the page at the end, sort pages by number and then get the number of the last page with $page->num().