portal.getSiteΒΆ

This command returns the parent site of the content corresponding to the current execution context. It is meant to be called from a page, layout or part controller.

Example:

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

log.info('Current site module config = ' + result.moduleConfigs['myModule']);

Result:

{
  "_id": "100123",
  "_name": "my-content",
  "_path": "/my-content",
  "data": {
    "moduleConfig": [
      {
        "config": [
          {
            "Field": [42]
          }
        ],
        "moduleKey": ["mymodule"]
      }
    ]
  },
  "draft": false,
  "hasChildren": false,
  "x": {},
  "moduleConfigs": {
    "mymodule": {
      "Field": [42]
    }
  },
  "page": {},
  "type": "system:unstructured"
}