XML 設定ファイルの要素
HTML テンプレートディレクティブ
HTML テンプレートエラー
デコレータ
@salesforce モジュール
getContent
getContext
updateContent
PageReference の型
updateContentコンテンツエディタで、拡張 CMS ワークスペースのコンテンツ項目の title と contentBody を更新します。ユーザが、コンテンツエディタで [保存] をクリックすると、更新が永続化されます。
this.context.data.schema.schema.properties を使用することで、コンテンツタイプの contentBody プロパティ項目のリストを返すことができます。
1import { LightningElement, wire } from 'lwc';
2import { updateContent } from experience/cmsEditorApi;
3class Example extends LightningElement{
4 // change the content in the editor
5 updateContent({
6 "title": "new title",
7 "contentBody: {
8 "name": "New name",
9 "description": "New description",
10 "excerpt": "new-excerpt"
11 }
12 }).then(() => {
13 //handle success
14 })
15}contentBody — (省略可能) コンテンツ本文の JSON 表現。コンテンツタイプによって返されるデータは異なります。Salesforce ヘルプの「Salesforce CMS のコンテンツに対応する JSON ファイル形式」を参照してください。title — (省略可能) エディタ内のコンテンツ項目の新しいタイトル。updateContent 応答が返されたときに解決される Promise オブジェクト。error — 無効な項目に対する検証エラー。The Japanese Summer '24 guide is now live