EditorUrl Action

This action is used to build the URL of the Visual Builder editor from an application at runtime. It gathers multiple pieces of information and returns a URL with request parameters representing various contextual info needed by the editor.

The action module for this action is vb/action/builtin/editorUrlAction.

Note:

This action should not be used for mobile applications.

The base URL pointing to the editor location is either passed as an argument to the action or has to be defined in the EDITOR_URL property of the vbInitConfig global object. If this value is not available, the action will abort with an error. Depending if the dynamicLayout request parameter is defined, the editor will either edit the current page or the ruleset of a specific dynamic component.

Here is an example of editorUrlAction usage:

"openEditor": {
  "variables": {
    "componentId": {
      "type": "string",
      "input": "fromCaller",
      "required": true
    }
  },
  "root": "editorUrl",
  "actions": {
    "editorUrl": {
      "module": "vb/action/builtin/editorUrlAction",
      "parameters": {
        "componentId": "{{ $variables.componentId }}"
      },
      "outcomes": {
        "success": "openEditor"
      }
    },
    "openEditor": {
      "module": "vb/action/builtin/openUrlAction",
      "parameters": {
        "url": "{{ $chain.results.editorUrl }}",
        "windowName": "VB_EDITOR"
      }
    }
  }
}
Parameter Description
editorUrl URL of the VB Extension editor (optional). If not defined, use the value of vbInitConfig.EDITOR_URL.
componentId The id of the component to use to retrieve the dynamic layout. (optional)