XML 設定ファイルの要素
HTML テンプレートディレクティブ
HTML テンプレートエラー
デコレータ
@salesforce モジュール
getContent
getContext
updateContent
PageReference の型
getContentコンテンツエディタで、拡張 CMS ワークスペースにあるコンテンツ項目の title、urlName、contentBody をコンテンツタイプ (画像、ニュース、ドキュメント、カスタムコンテンツ) に基づいて取得します。
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 — コンテンツ本文の JSON 表現。コンテンツタイプによって返されるデータは異なります。Salesforce ヘルプの「Salesforce CMS のコンテンツに対応する JSON ファイル形式」を参照してください。title — コンテンツ項目のタイトル。urlName — コンテンツスラッグ。URL アドレスの最後の部分です。error — 無効な項目に対する検証エラー。The Japanese Summer '24 guide is now live