Skip to content

Commit a0cb8a9

Browse files
committed
add attention to store config
1 parent 4a23735 commit a0cb8a9

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* Copyright © Magefan ([email protected]). All rights reserved.
4+
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
5+
*/
6+
7+
namespace Magefan\GoogleTagManager\Block\Adminhtml\System\Config\Form;
8+
9+
use Magento\Framework\Data\Form\Element\AbstractElement;
10+
11+
/**
12+
* Admin configurations information block
13+
*/
14+
class Attention extends \Magefan\Community\Block\Adminhtml\System\Config\Form\Info
15+
{
16+
17+
/**
18+
* Return info block html
19+
*
20+
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
21+
* @return string
22+
*/
23+
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
24+
{
25+
return '<div style="padding:10px;background-color:#ffe5e5;border:1px solid #ddd;margin-bottom:7px;">
26+
<strong>Attention!</strong> Once you made and saved all the configurations,
27+
please don\'t forget to scroll down to the "Export Container" section
28+
and click the "Generate JSON Container & Download File" button to export container data.
29+
After you save the file, <a target="_blank" title="Create GTM tags" href="https://magefan.com/blog/add-google-tag-manager-to-magento-2#5-create-gtm-tags">
30+
import it to your Google Tag Manager container.</a>
31+
</div>';
32+
}
33+
}
34+

etc/adminhtml/system.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<field id="version" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
1919
<frontend_model>Magefan\GoogleTagManager\Block\Adminhtml\System\Config\Form\Info</frontend_model>
2020
</field>
21+
<field id="attention" translate="label comment" type="text" sortOrder="9999" showInDefault="1" showInWebsite="1" showInStore="1">
22+
<frontend_model>Magefan\GoogleTagManager\Block\Adminhtml\System\Config\Form\Attention</frontend_model>
23+
</field>
2124
<field id="enabled" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
2225
<label>Enable Extension</label>
2326
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>

0 commit comments

Comments
 (0)