legacy-knowledge-base
公開されました Jun. 30, 2025

<@liferay_aui.script> キャッシュを無効にしたJournal Articleテンプレートでtaglib JavaScriptが2回実行される

written-by

Daniel Carrillo Broeder

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

問題

  • ウェブコンテンツテンプレート内の<@liferay_aui.script>taglib 内に追加された JavaScript が 2 回実行され、意図しない動作になります。 以下に例を示します。
  • <@liferay_aui.script use="aui-base,aui-video">
       console.log("Hello world!");
    </@liferay_aui.script>
  • ウェブコンテンツテンプレートはキャッシュ不可能とマークされています。

環境

  • Liferay DXP 7.3.

解像度

  • 現在のところ、この問題に対する公式な解決策はなく、今後も実装される予定はない。
  • 幸いなことに、迅速な回避策が存在する。 taglibを同等のJavaScriptコードに置き換えるだけです。

  • <script type="text/javascript">
        AUI().use("aui-baser","aui-video", function(A){
               console.log("Hello World!");
            }
        );
    </script>
  • 可能であれば、この問題に関係なく、パフォーマンスを向上させるためにテンプレートをキャッシュ可能としてマークすることを検討してください。

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base