Retrieves metadata about the content item in the content editor in an enhanced CMS workspace.
Syntax
import { LightningElement, wire } from 'lwc';
import { getContext } from experience/cmsEditorApi;
export default class Example extends LightningElement {
@wire(getContext, {})
context;
}
Returns
datavariantId—ID of the content variant.contentSpaceId—ID of the workspace that contains the content item.managedContentId—ID of the CMS content item.contentKey—Unique identifier that tracks a content item through version updates and across environments. Assigned automatically when content is added to a CMS workspace.schema—Information layout based on the content type.
error—A validation error for invalid fields.