タグ付けされた質問 「system.xml」

system.xmlモジュール構成ファイルに関連する質問を示します。

4
新しい拡張機能のインストールで404エラーを回避する方法
system.xml configを使用して新しい拡張機能をインストールすると、Magentoに表示される非常に一般的なエラーです。 System->Configuration->Extensionタブに移動すると、404エラーが表示されます。ログアウトして再度ログインする必要がありますが、その後は問題ありません。しかし、これを回避する方法はありますか?

2
Magento 2:「system.xml」設定のデフォルト値
Magento 1では、次のことができました。 etc/system.xmlファイル内のシステム構成セクションのユーザーインターフェイスの構成 etc/config.xmlファイル内のこれらのフィールドにデフォルト値を設定します 舞台裏では、Magentoはからデータをロードしcore_config_data、何も設定されていない場合、デフォルトでにグローバルに設定された値になりますetc/config.xml。(簡易バージョン—それよりも少し複雑です) Magento 2でも同じことができますか?経由でUI要素を構成system.xmlすることは可能ですが、これらの設定にデフォルト値を設定することは可能ですか?その場合、これらの値はどこで、どのように構成する必要がありますか?


2
system.xmlフィールドの依存関係
したがって、フィールドの1つにタグをsystem.xml追加することにより、モジュールのファイルでフィールド間の依存関係を設定でき<depends>ます。 <field1> .... </field1> <field2> .... <depends> <field1>1</field1> </depends> </field2> 上記のコードはfield2、の値がのときに表示されることを意味します。の値がORであるかどうかをMagentoに指示する方法を教えてください。field11field2field112

1
グループ/フィールドセット間のsystem.xmlの依存関係
system.xmlを使用すると、個々のフィールドの可視性を他のフィールドの値に依存させることができます。gotoの記事は、もちろんAlan Storm:In Depth Magento System Configurationからのものです。 次のようになります(ここで彼のサンプルコードを借りています)。 Location: app/code/local/Alanstormdotcom/Helloworld/etc/system.xml <config> <tabs> <helloconfig translate="label" module="helloworld"> <label>Hello Config</label> <sort_order>99999</sort_order> </helloconfig> </tabs> <sections> <helloworld_options translate="label" module="helloworld"> <label>Hello World Config Options</label> <tab>helloconfig</tab> <frontend_type>text</frontend_type> <sort_order>1000</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> <groups> <notes translate="label"> <label>Demo Of Config Fields NOTES</label> <frontend_type>text</frontend_type> <sort_order>1</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> <fields> <enabled translate="label"> <label>Enabled</label> …


1
モジュール問題のMagento 2システム構成
私はこの問題の解決策を見つけるために多くのサイトを訪れました。 しかしsystem.xml、acl.xmlMagentoを作成してから、レポートでエラーが発生しました。 エラー a:4:{i:0; s:140: "通知:未定義のインデックス:/ usr / local / ampps / www / mgn2 / vendor / magento / module-config / Model / Config / Structure / Element / IteratorのID。 php on line 59 "; i:1; s:6391:"#0 /usr/local/ampps/www/mgn2/vendor/magento/module-config/Model/Config/Structure/Element/Iterator.php(59) :Magento \ Framework \ App \ ErrorHandler-> handler(8、 '未定義のインデックス...'、 '/ usr …

1
管理構成:選択した複数選択値に応じてフィールドを表示
選択された複数選択入力に基づいてフィールドを表示したい...値が1つしか選択されていない場合、次のコードは正しく機能します。複数の値を選択すると、1つのフィールドのみが表示されます(最初にソースモデルから選択) <enabled> <label>Enabled</label> ... <source_model>adminhtml/system_config_source_enabledisable</source_model> </enabled> <!-- this gives three options - shop, ebay, amazon --> <channels> ... <frontend_type>multiselect</frontend_type> <source_model>module/system_config_source_channels</source_model> <depends> <enabled>1</enabled> </depends> </channels> <mail_template_shop> ... <depends> <enabled>1</enabled> <channels>shop</channels> </depends> </mail_template_shop> <mail_template_ebay> ... <depends> <enabled>1</enabled> <channels>ebay</channels> </depends> </mail_template_ebay> 関連コード: app / code / core / Mage / Adminhtml / Block …

3
システム構成のカスタム動的フィールドに画像フィールドを追加するにはどうすればよいですか?
管理者ユーザーが必要なだけフィールドを生成できるようにしたい。別の拡張機能で解決策を見つけ、それを出発点として使用しました。だから私はこのようなコードを持っています: でsystem.xml: <showcases translate="label"> <label>Showcases</label> <frontend_type>text</frontend_type> <sort_order>10</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> <fields> <showcase translate="label"> <label>Showcases</label> <frontend_type>select</frontend_type> <frontend_model>awesomehome/adminhtml_showcases</frontend_model> <backend_model>adminhtml/system_config_backend_serialized</backend_model> <sort_order>410</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </showcase> </fields> </showcases> そしてでNamespace/Awesomehome/Block/Adminhtml/Showcases.php: class Namespace_Awesomehome_Block_Adminhtml_Showcases extends Mage_Adminhtml_Block_System_Config_Form_Field { protected $_addRowButtonHtml = array(); protected $_removeRowButtonHtml = array(); protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) { $this->setElement($element); $html = '<div id="showcase_template" style="display:none">'; $html …

3
Magento 2:フィールドが同じグループにない場合、フィールドはsystem.xmlに依存します
<depends>同じフィールドグループに属していないフィールドを設定するにはどうすればよいですか <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="section" translate="label" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Name</label> <tab>tabname</tab> <resource>Namespace_ModuleName::method</resource> <group id="group" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> <label>General Configuration</label> <field id="field" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Enable</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> </field> </group> <group id="connection" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Connection Configuration</label> …

2
system.xmlでのカスタムフィールドの検証
私はmagento2プラグインを開発しています(私はmagento2の新機能です)、system.xmlのフィールドの検証で問題が発生しました。私は長い間探していましたが、答えが見つかりませんでした。新しいフィールドを追加しましたが、正規表現を使用してこのフィールドを検証する必要があります。デフォルトの検証がいくつかあることを確認しましたが、カスタムの検証が必要です。新しい検証ルールをバリデーターに追加する方法はありますか?


3
System Config Multiselect default all all selected
multiselectタイプのシステム構成フィールドがあり、を使用して入力されますcatalog/product_attribute_collection。これはsystem.xmlそれを定義するの一部です。 <attributes> <label>Choose Attributes to JSONize</label> <frontend_type>multiselect</frontend_type> <sort_order>3</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>package_module/system_config_attributes</source_model> </attributes> 次に、複数選択のすべての値がデフォルトで選択されるようにします。システム設定のデフォルト値はで定義されているためconfig.xml、すべてをデフォルトとして選択する方法がわかりません。 これはconfig.xml質問に関連するセクションです <default> <mytab> <mysection> <attributes><!-- ***WHAT SHOULD I WRITE HERE*** --></attributes> </mysection> </mytab> </default>

1
構成はフロントモデルとバックエンドモデルに「依存」します
構成の「依存」機能に問題があります。 通常、<depends>いくつかの構成オプションに追加されますが、指定されたオプションの値が一致しない限り、それは非表示になります。 例えば: <option_one> <label>Option 1</label> ... </option_one> <option_two> <label>Option 2</label> ... <depends><option_one>1</option_one></depends> </option_two 明らかに、いくつかのフィールドが欠けていますが、要点はわかります。オプション2は、オプション1の値が「1」の場合にのみ表示されます。 私の問題は、これをバックエンドモデルとフロントエンドモデルのオプションに適用しようとすると、これに依存しないことです。 <option_three> ... <frontend_model>module/adminhtml_form_field_test</frontend_model> <backend_model>adminhtml/system_config_backend_serialized_array</backend_model> ... <depends><option_one>1</option_one></depends> </option_three> このオプションはオプション1を考慮せず、常に表示されるだけです。 私は何か間違っているのですか、それともバグですか、それとも「設計どおりに機能する」のですか?


弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.