Hiding Menu Items Based on Tailor Globals

Hey everyone. So I’ve found this documentation on hiding menu items in other plugins:

My problem is, I would like to hide the menu items as soon as the save button is hit on tailor globals. It would make as a great experience UI wise. Currently, the turbo router for the backend is preventing this.

My approach before was hiding the menus with CSS and JavaScript with the backend.page.beforeDisplay event but that doesn’t work either since the assets are only added after a refresh as well.

How would you go about this.

Some ideas: You can disable turbo for the next page load with this code.

<script>
// Always force a reload of the next page
oc.AjaxTurbo.controller.disable();
</script>

You can force a reload of the page by adding this to the Save button.

data-request-success="window.location.reload()"
1 Like

This was the last piece I was missing. Thank you!

1 Like