|
33 | 33 | <group id="web_container" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" > |
34 | 34 | <label>Web Container</label> |
35 | 35 | <attribute type="expanded">1</attribute> |
36 | | - <!-- |
37 | | - <field id="enable" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> |
38 | | - <label>Enable</label> |
| 36 | + <field id="enabled" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> |
| 37 | + <label>Enable Web Container</label> |
39 | 38 | <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> |
40 | 39 | </field> |
41 | | - --> |
42 | 40 | <field id="install_gtm" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> |
43 | 41 | <label>Google Tag Manager Installation Method</label> |
| 42 | + <depends> |
| 43 | + <field id="enabled">1</field> |
| 44 | + </depends> |
44 | 45 | <source_model>Magefan\GoogleTagManager\Model\Config\Source\InstallGtmOptions</source_model> |
45 | 46 | </field> |
46 | 47 | <field id="public_id" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1"> |
|
68 | 69 | ]]> |
69 | 70 | </comment> |
70 | 71 | <depends> |
| 72 | + <field id="enabled">1</field> |
71 | 73 | <field id="mfgoogletagmanager/web_container/install_gtm">use_public_id</field> |
72 | 74 | </depends> |
73 | 75 | </field> |
74 | 76 | <field id="script_content" translate="label comment" type="textarea" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1"> |
75 | 77 | <label>Head Script</label> |
76 | 78 | <depends> |
| 79 | + <field id="enabled">1</field> |
77 | 80 | <field id="mfgoogletagmanager/web_container/install_gtm">use_head_and_body_script</field> |
78 | 81 | </depends> |
79 | 82 | <comment> |
|
95 | 98 | <field id="noscript_content" translate="label comment" type="textarea" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1"> |
96 | 99 | <label>Body Noscript</label> |
97 | 100 | <depends> |
| 101 | + <field id="enabled">1</field> |
98 | 102 | <field id="mfgoogletagmanager/web_container/install_gtm">use_head_and_body_script</field> |
99 | 103 | </depends> |
100 | 104 | <comment> |
|
112 | 116 | </field> |
113 | 117 | <field id="account_id" translate="label comment" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1"> |
114 | 118 | <label>Account ID</label> |
| 119 | + <depends> |
| 120 | + <field id="enabled">1</field> |
| 121 | + </depends> |
115 | 122 | <comment> |
116 | 123 | <![CDATA[ |
117 | 124 | <p>Please get the <a href="https://tagmanager.google.com/" title="Google Tag Manager" target="_blank">Google Tag Manager</a> account ID from the GTM Workspace URL path. E.g.<br/> |
|
121 | 128 | </field> |
122 | 129 | <field id="container_id" translate="label comment" type="text" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1"> |
123 | 130 | <label>Container ID</label> |
| 131 | + <depends> |
| 132 | + <field id="enabled">1</field> |
| 133 | + </depends> |
124 | 134 | <comment> |
125 | 135 | <![CDATA[ |
126 | 136 | <p>Please get the <a href="https://tagmanager.google.com/" title="Google Tag Manager" target="_blank">Google Tag Manager</a> container ID from the GTM Workspace URL path. E.g.<br/> |
@@ -449,6 +459,9 @@ To create a new secret, navigate in the |
449 | 459 | </group> |
450 | 460 | <group id="container" translate="label" type="text" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1"> |
451 | 461 | <label>Export Web Container</label> |
| 462 | + <depends> |
| 463 | + <field id="mfgoogletagmanager/web_container/enabled">1</field> |
| 464 | + </depends> |
452 | 465 | <field id="export" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> |
453 | 466 | <frontend_model>Magefan\GoogleTagManager\Block\Adminhtml\System\Config\Form\ExportWebContainerButton</frontend_model> |
454 | 467 | </field> |
|
0 commit comments