legacy-knowledge-base
公開されました Jul. 2, 2025

ウェブコンテンツに繰り返し使えるHTMLフィールドを追加すると、EditorConfigContributorファイル内に追加したカスタム設定が失われる

written-by

Georgel Pop

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • CKEditor 内のカスタム EditorConfigContributor を使用すると、適用時にうまくいく:
    "javax.portlet.name=com_liferay_journal_web_portlet_JournalPortlet"
  • しかし、ウェブコンテンツの構造上、HTMLフィールドに繰り返し可能な要素がある場合、繰り返し可能な要素の最初のインスタンスでは、config contributorの中で定義されたこれらの設定は無視されます:
    • カスタム設定は、すでに作成された要素にのみ適用されます。
    • 要素を繰り返すボタンを押すと、新しい要素はデフォルトの設定で表示され、config contributorファイルで上書きした設定にはなりません。
    • コンテンツを保存し、再度開いたときに初めて、新たに作成された繰り返し要素にカスタム設定が適用されます。

Environment

  • 7.0以上

解決策

  • HMTLの繰り返し入力可能なフィールドに同じ設定を適用するためには、以下の設定も必要です:
    "javax.portlet.name=com_liferay_dynamic_data_mapping_web_portlet_DDMPortlet"
    は、新しく作られた要素に使われるからです。
  • 上記の物件です:
    "javax.portlet.name=com_liferay_journal_web_portlet_JournalPortlet"
    は、既存のフィールドを編集するときのみ使用されます。
  • 結果、この2つのプロパティをこのように追加することで動作します:
    @Component(
    immediate = true,
    property = {
    "editor.name=ckeditor",
    "editor.name=ckeditor_classic",
    "javax.portlet.name=com_liferay_journal_web_portlet_JournalPortlet",
    "javax.portlet.name=com_liferay_dynamic_data_mapping_web_portlet_DDMPortlet",
    "service.ranking:Integer=100"
    },
    service = EditorConfigContributor.class)

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base