XML 設定ファイルの要素
HTML テンプレートディレクティブ
HTML テンプレートエラー
デコレータ
@salesforce モジュール
getContent
PageReference の型
getContentExperience Cloud の拡張 LWR サイトの拡張 CMS ワークスペースから公開コンテンツを取得します。
Aura または非拡張 LWR サイトの CMS ワークスペースから Salesforce CMS コンテンツを取得する場合は、代わりに lightning/cmsDeliveryApi モジュールの listContent ワイヤアダプタを使用します。
Note
1import { LightningElement, api, wire } from "lwc";
2import { getContent } from "experience/cmsDeliveryApi";
3import siteId from "@salesforce/site/Id";
4
5export default class GetContentCmsDeliveryApiV2 extends LightningElement {
6 @api contentKey;
7
8 data;
9
10 @wire(getContent, { channelOrSiteId: siteId, contentKeyOrId: "$contentKey" })
11 onGetContent(result) {
12 if (result.data) {
13 this.data = result.data;
14 }
15 }
16}channelId パラメータを使用する場合:
1GET /connect/cms/delivery/channels/${channelId}/contents/${contentKeyOrId}siteId パラメータを使用する場合:
1GET /connect/sites/${siteId}/cms/delivery/contents/${contentKeyOrId}channelOrSiteId — (必須) CMS コンテンツを使用する拡張 LWR サイトの ID。contentKeyOrId — (必須) 拡張 LWR サイトで使用する CMS コンテンツのコンテンツキーまたはコンテンツ ID。data — Managed Content Delivery Documenterror — FetchResponseThe Japanese Summer '24 guide is now live