How to temporarily hide the Sidebar on form open

Whenever a form is opened (and the browser window is wide enough to accommodate it without totally obscuring the page content), the default behavior is to display the navigation sidebar.

I have a Layout form for which I’d like to change this behavior: I want the sidebar to initially be hidden when a form using this layout is opened – but otherwise to preserve the ‘hamburger menu’ (image) functionality of toggling between showing and hiding the sidebar.

I found the hideSidebar and showSidebar functions within the standard.html file, but my understanding of both Javascript and CSS is extremely limited.

I tried putting self.call_js("hideSidebar") in the form’s show event. While that did hide the sidebar, but it also stopped the hamburger menu from working. :frowning:

I’d be grateful for a pointer or two (if not “the answer”. :smile:) Thanks in advance!