0
モジュールのバックエンド設定の属性( "yes/no")が "yes"に設定されている場合のみ、カスタムJSファイルをモジュールに追加します。バックエンドモジュールの設定に依存してカスタムJSファイルをロードする
これまでのところ、私はこのようなモジュールconfig.xml内の私のlayout.xmlファイルを参照しています
<frontend>
<layout>
<updates>
<modulename>
<file>modulename.xml</file>
</modulename>
</updates>
</layout>
</frontend>
予想通りlayout.xmlが.jsファイルをロードします。私はそれが可能であればSystem.Xmlのファイルにしたものと同様の依存関係を追加したいと思いますけれども:
とにかく<sortby translate="label">
<label>Sort by:</label>
<frontend_type>select</frontend_type>
<sort_order>40</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<source_model>path/to_settings</source_model>
<depends><sortby>1</sortby></depends>
</sortby>
、どのように私はバックエンドの設定フィールドの値に依存するカスタムJSファイルを読み込むことができますか?次のようにあなたが追加することができます