Advanced Toolbar Customizations
Important: Usually only editors see these toolbars - so saving won't work. Hover over the various boxes to see the result - like this:
Important: The feature "Public Use of Edit Form" is disabled
If you want this demo to run for anonymous users you would need it. Register your site on patrons.2sxc.org to get access to the feature.Switch to Typed (2sxc 16+) Switch to Dynamic (Razor14 or below)
2sxc UI - Toolbar Workflows
Toolbars will automatically do things like open a dialog or refresh the page when the dialog closes. But sometimes you want to override or change the default behavior - like:
- Prevent refresh on dialog close - to retrieve the data in JS
- Prevent creating new if a specific condition applies
This is what the Workflows are for. You can register custom before
and after
code to run, change specs or prevent the action from executing. Read the workflow docs or the toolbar docs to learn more about this.
Use cms.run() to call Toolbar Commands from JS-Events
In some cases you need to call a CMS command without using the toolbar - like in SPAs and in situations where a normal HTML button should call edit. You can also use this to trigger Workflows (new in 12.10).
You can register custom before
and after
code to run, change specs or prevent the action from executing. Read the workflow docs or the toolbar docs to learn more about this.