Develop Secure Code
getContent
getContext
updateContent
getContentRetrieves the title, urlName, and contentBody of the content item in the content editor in an enhanced CMS workspace based on the content type—image, news, document, or custom content.
1import { LightningElement, wire } from 'lwc';
2import { getContent } from experience/cmsEditorApi;
3
4export default class Example extends LightningElement {
5 @wire(getContent, {})
6 content;
7}data
contentBody—The JSON representation of the content body, which varies depending on the content type. See JSON File Format for Content in Salesforce CMS in Salesforce Help.title—The title of the content item.urlName—The content slug, which is the last part of the URL address.error—A validation error for invalid fields.