get-allowed-components-by-placeholder
Lists renderings a Sitecore placeholder permits before you add a component, using site/global settings and dynamic wildcard matching. Returns allowed control IDs and unresolved IDs.
Instructions
Lists the renderings a placeholder allows on a given page, read from the placeholder settings items that govern it. Call this before adding a rendering: a placeholder that forbids a component will still accept it silently, and the page will render. Resolves site-level settings first (/Presentation/Placeholder Settings) and falls back to the global tree (/sitecore/layout/Placeholder Settings/Project/...); settingsItemPath in the result says which item answered. Handles dynamic placeholders: a runtime path like /headless-main/page-section-1/container-2 is matched on its leaf segment against wildcard keys such as container-{*}. Allowed control IDs that resolve to no item are reported under 'Unresolved' rather than dropped silently — that is a content defect worth seeing. Found=false means no settings item governs the key, so check the spelling before treating it as unrestricted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | The full path of the item, database prefix optional (e.g. master:/sitecore/content/Stride/Cova/Home or /sitecore/content/Stride/Cova/Home). Supply this or pageId. | |
| pageId | No | The ID of the page item (e.g. {110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}). Supply this or path. | |
| project | No | Overrides the folder searched under /sitecore/layout/Placeholder Settings/Project. Defaults to the project (tenant) folder of the site the item belongs to, and falls back to the whole global Placeholder Settings tree. | |
| database | No | The database to read. Defaults to master, and is ignored when path carries its own prefix. | |
| language | No | The item language. Defaults to the context language. | |
| placeholderPath | Yes | The placeholder to resolve. Accepts a bare key ('headless-main', 'container', 'container-{*}') or a full runtime placeholder path ('/headless-main/page-section-1/container-2'), in which case the leaf segment is matched — including against the wildcard keys dynamic placeholders use. |