portal.getComponentΒΆ

This command returns the component corresponding to the current execution context. It is meant to be called from a layout or part controller.

Example:

var result = execute('portal.getComponent');

log.info('Current component name = ' + result.name);

Result:

{
  "config": {
    "a": ["1"]
  },
  "descriptor": "mymodule:mylayout",
  "name": "mylayout",
  "path": "main/-1",
  "regions": {
    "bottom": {
      "components": [
        {
          "config": {
            "a": ["1"]
          },
          "descriptor": "mymodule:mypart",
          "name": "mypart",
          "path": "main/-1/bottom/0",
          "type": "part"
        }
      ]
    }
  },
  "type": "layout"
}