Silverstripe Version: 4.13
Question:
I have some js which opens a popup window displaying the edit details view for a new data object. I’m able to populate fields using:
public function populateDefaults() {
// check if date has been passed in from calendar
$date = Controller::curr()->getRequest()->getVar("DateTimeStart");
if ($date != null) {
$this->DateTimeStart = date($date . ' H:i:s');
$this->DateTimeEnd = date($date . ' H:i:s');
}
parent::populateDefaults();
}
This is all working fine, but I’m wondering whether there’s a way to hide the entire CMS menu for the popup so that it is less cluttered and users can’t navigate away from it. Is it possible to pass in a request variable to enable hiding the CMS menu, eg.
...EditForm/field/active/item/new?DateTimeStart=2024-05-02?HideCMSMenu=true
I’d then also want to change what happens when a user clicks the cancel button, the window is simply closed (rather than navigating to the events model admin).
I’ve tried hiding the menu panel using js by adding class “hide” or style “display:none;” to id=“cms-menu” (works in browser web inspector), however this is somehow being overridden in the new window.
Any help is much appreciated.