getContents

Retrieves a list of published content from an enhanced CMS workspace or non-enhanced CMS workspace for an enhanced LWR site in Experience Cloud. This wire adapter can also retrieve published content from a non-enhanced CMS workspace for a non-enhanced LWR site.

To get Salesforce CMS content from an enhanced or non-enhanced CMS workspace for an Aura site, use the lightning/cmsDeliveryApi module’s listContent wire adapter instead.

With channelId parameter:

With siteId parameter:

getContent uses this CMS Delivery Contents Resource.

Parameter NameTypeDescriptionRequired?
channelOrSiteIdStringThe ID for the enhanced LWR site on which you want to use CMS content.Yes
contentKeysString[]The content keys for the CMS content that you want to use on your enhanced LWR site.
managedContentIdsString[]The managed content IDs for the CMS content that you want to use on your enhanced LWR site.
contentTypeFQNStringFully qualified name of the managed content type.
referenceDepthIntegerAn integer 0–3 specifying the depth of references.
pageIntegerNumber of the page you want returned. Starts at 0. If you don’t specify a value or if you specify 0, the first page is returned.
pageSizeIntegerSpecifies the number of items per page. Valid values are from 1 through 250. If unspecified, the default size is 25.
includeContentBodyBooleanSpecifies whether to return the content body (true) or summaries of references (false) in the response body. If unspecified, the default value is false.