The OLD $2sxc.cms.run(...) API v9.30
Warning
This is documentation for an old feature. You should use the new one instead
How to use (v9.30)
Before you start, ensure you have the necessary JS scripts loaded. See Activate 2sxc JavaScript APIs on a Page.
Simple example:
<script>
// simple function to run the command and handle the returned promise
function addProject(tag) {
$2sxc.cms.run(tag, "new", { contentType: "Project"})
.then(function () {
alert("Thanks - we'll review your entry and publish it.")
});
}
</script>
<span onclick='window.addProject(this)'>
add your project
</span>
- the first parameter is an HTML tag in the DOM, which is used to look up the context automatically (see edit-context)
- the second parameter is the verb for the cms-command to run
- the third parameter is additional parameters for that command
Demo App and further links
History
- Introduced in 2sxc 09.30
- Made obsolete with new
RunParams
in 2sxc 12.10 to support registeringworkflows
- see SxcGlobalCms