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

DXPでは、埋め込みポートレットでサイトごとの設定を区別することはできません

written-by

Alfonso Crisci

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

問題

  • DXPでは、以下のようにポートレットを埋め込むことができます
    <#assign preferencesMap = {"portletSetupPortletDecoratorId" : "barebone"} />

    <@liferay_portlet["runtime"]
    instanceId="1234"
    defaultPreferences=freeMarkerPortletPreferences.getPreferences(preferencesMap)
    portletProviderAction=portletProviderAction.VIEW
    portletName="my_test_portlet_web_MyTestPortletWeb"
    />
    これは動作しますが、1つのインスタンスでルック&フィールや設定を調整すると、別のページに埋め込まれた同じポートレットで同じ設定が複製されてしまいます

    設定を分離するにはどうすればいいのでしょうか?

環境

  • Liferay DXP 7.0以降

詳細

  • 例えば、 instanceIdを動的に区別します
    <#assign preferencesMap = {"portletSetupPortletDecoratorId" : "barebone"} />

    <@liferay_portlet["runtime"]
    instanceId="FOOTER${plid}"
    defaultPreferences=freeMarkerPortletPreferences.getPreferences(preferencesMap)
    portletProviderAction=portletProviderAction.VIEW
    portletName="my_test_portlet_web_MyTestPortletWeb"
    />

追加情報

 

did-this-article-resolve-your-issue

legacy-knowledge-base