(SOLVED) add external link in custom magento pluginHow can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento2 add custom jquery pluginMagento 2 - Set a custom external link in footerMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsCannot add custom topmenu link with pluginAdd custom fields in Magento 2 plugin
How to manage monthly salary
What is the command to reset a PC without deleting any files
Where to refill my bottle in India?
What does 'script /dev/null' do?
"My colleague's body is amazing"
What is the offset in a seaplane's hull?
What is the meaning of "of trouble" in the following sentence?
Patience, young "Padovan"
I see my dog run
What does "enim et" mean?
extract characters between two commas?
Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?
Crop image to path created in TikZ?
Email Account under attack (really) - anything I can do?
Could Giant Ground Sloths have been a good pack animal for the ancient Mayans?
Why do UK politicians seemingly ignore opinion polls on Brexit?
Are objects structures and/or vice versa?
Calculate Levenshtein distance between two strings in Python
aging parents with no investments
Does the average primeness of natural numbers tend to zero?
Does bootstrapped regression allow for inference?
Is it wise to hold on to stock that has plummeted and then stabilized?
Why is my log file so massive? 22gb. I am running log backups
How to answer pointed "are you quitting" questioning when I don't want them to suspect
(SOLVED) add external link in custom magento plugin
How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento2 add custom jquery pluginMagento 2 - Set a custom external link in footerMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsCannot add custom topmenu link with pluginAdd custom fields in Magento 2 plugin
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm updating a Magento plugin and I'd like to add an external link like this:
<a href="myweblink" target "_blank">My weblink </a>
I tried to do it adding these lines in layout.xml file (that is the model I use)
<?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">
<referenceContainer name="footer">
<block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="footer_blog_link" before="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Condizioni di contratto e termini di utilizzo</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/termini-utilizzo/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
<arguments>
<argument name="label" xsi:type="string" translate="true">Regolamento integrarivo (delle Condizioni di Contratto) per l'UTENTE che utilizza moduli per E-Commerce di Fattura24</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/regolamento-ecommerce/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
<arguments>
<argument name="label" xsi:type="string" translate="true">Privacy</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/policy/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
</block>
</referenceContainer>
I'm not displaying the links in admin footer of my extension.
I put this file in /adminhtml/layout
then I updated the app, flushed magento cache, reindexed but still can't display links
magento2
add a comment |
I'm updating a Magento plugin and I'd like to add an external link like this:
<a href="myweblink" target "_blank">My weblink </a>
I tried to do it adding these lines in layout.xml file (that is the model I use)
<?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">
<referenceContainer name="footer">
<block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="footer_blog_link" before="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Condizioni di contratto e termini di utilizzo</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/termini-utilizzo/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
<arguments>
<argument name="label" xsi:type="string" translate="true">Regolamento integrarivo (delle Condizioni di Contratto) per l'UTENTE che utilizza moduli per E-Commerce di Fattura24</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/regolamento-ecommerce/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
<arguments>
<argument name="label" xsi:type="string" translate="true">Privacy</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/policy/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
</block>
</referenceContainer>
I'm not displaying the links in admin footer of my extension.
I put this file in /adminhtml/layout
then I updated the app, flushed magento cache, reindexed but still can't display links
magento2
Whysystem.xml
? you could not add this insystem.xml
and the error confirm that. Do it instead in layout
– PЯINCƏ
Mar 26 at 16:26
add a comment |
I'm updating a Magento plugin and I'd like to add an external link like this:
<a href="myweblink" target "_blank">My weblink </a>
I tried to do it adding these lines in layout.xml file (that is the model I use)
<?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">
<referenceContainer name="footer">
<block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="footer_blog_link" before="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Condizioni di contratto e termini di utilizzo</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/termini-utilizzo/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
<arguments>
<argument name="label" xsi:type="string" translate="true">Regolamento integrarivo (delle Condizioni di Contratto) per l'UTENTE che utilizza moduli per E-Commerce di Fattura24</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/regolamento-ecommerce/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
<arguments>
<argument name="label" xsi:type="string" translate="true">Privacy</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/policy/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
</block>
</referenceContainer>
I'm not displaying the links in admin footer of my extension.
I put this file in /adminhtml/layout
then I updated the app, flushed magento cache, reindexed but still can't display links
magento2
I'm updating a Magento plugin and I'd like to add an external link like this:
<a href="myweblink" target "_blank">My weblink </a>
I tried to do it adding these lines in layout.xml file (that is the model I use)
<?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">
<referenceContainer name="footer">
<block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="footer_blog_link" before="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Condizioni di contratto e termini di utilizzo</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/termini-utilizzo/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
<arguments>
<argument name="label" xsi:type="string" translate="true">Regolamento integrarivo (delle Condizioni di Contratto) per l'UTENTE che utilizza moduli per E-Commerce di Fattura24</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/regolamento-ecommerce/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
<arguments>
<argument name="label" xsi:type="string" translate="true">Privacy</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/policy/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
</block>
</referenceContainer>
I'm not displaying the links in admin footer of my extension.
I put this file in /adminhtml/layout
then I updated the app, flushed magento cache, reindexed but still can't display links
magento2
magento2
edited Apr 5 at 9:55
Davide Iandoli
asked Mar 26 at 15:38
Davide IandoliDavide Iandoli
63
63
Whysystem.xml
? you could not add this insystem.xml
and the error confirm that. Do it instead in layout
– PЯINCƏ
Mar 26 at 16:26
add a comment |
Whysystem.xml
? you could not add this insystem.xml
and the error confirm that. Do it instead in layout
– PЯINCƏ
Mar 26 at 16:26
Why
system.xml
? you could not add this in system.xml
and the error confirm that. Do it instead in layout– PЯINCƏ
Mar 26 at 16:26
Why
system.xml
? you could not add this in system.xml
and the error confirm that. Do it instead in layout– PЯINCƏ
Mar 26 at 16:26
add a comment |
2 Answers
2
active
oldest
votes
If you want to add that in admin area:
app/code/Vendor/Modulename/view/adminhtml/layout/your_layout_name.xml
<referenceContainer name="footer">
<block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="footer_blog_link" before="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Condizioni di contratto e termini di utilizzo</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/termini-utilizzo/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
...
I added the code you suggested, then I updated my app and flush magento cache, and reindex, but I can't display the link in admin
– Davide Iandoli
Mar 27 at 8:16
The footer of admin Magento or if your admin footer extension ?
– PЯINCƏ
Mar 27 at 8:58
the admin footer of my extension
– Davide Iandoli
Mar 27 at 9:10
ok, can you share me the layout extension content ?
– PЯINCƏ
Mar 27 at 9:12
updated question :-) Thanks
– Davide Iandoli
Mar 27 at 9:24
|
show 5 more comments
At last I solved in this way: I edited system.xml adding code like this:
<field id="info_link" translate="label" type="button" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<frontend_model>Fattura24AppFatturazioneBlockSystemConfigInfoLink</frontend_model>
</field>
Then I created an InfoLink.php file:
<?php
namespace Fattura24AppFatturazioneBlockSystemConfig;
class InfoLink extends MagentoConfigBlockSystemConfigFormField
{
protected $_template = 'Fattura24_AppFatturazione::system/config/infoLink.phtml';
public function __construct
(
MagentoBackendBlockTemplateContext $context,
MagentoFrameworkObjectManagerInterface $objectManager,
array $data = []
)
$this->objectManager = $objectManager;
$this->storeManager = $context->getStoreManager();
parent::__construct($context, $data);
/**
* Remove scope label
*
* @param AbstractElement $element
* @return string
*/
public function render(MagentoFrameworkDataFormElementAbstractElement $element)
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
/**
* Return element html
*
* @param AbstractElement $element
* @return string
*/
protected function _getElementHtml(MagentoFrameworkDataFormElementAbstractElement $element)
return $this->_toHtml();
Eventually I added the template named infoLink.phtml:
<?php echo "<a href="https://www.fattura24.com/termini-utilizzo/" target="_blank">Condizioni di contratto e termini di utilizzo di Fattura24</a>" . "<br />";
echo "<a href="https://www.fattura24.com/regolamento-ecommerce/" target="_blank">Regolamento F24 integrativo (delle Condizioni di Contratto) per modulo Magento </a>" . "<br />";
echo "<a href="https://www.fattura24.com/policy/" target="_blank">Privacy di Fattura24</a>" . "<br />";
?>
That is working.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267488%2fsolved-add-external-link-in-custom-magento-plugin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you want to add that in admin area:
app/code/Vendor/Modulename/view/adminhtml/layout/your_layout_name.xml
<referenceContainer name="footer">
<block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="footer_blog_link" before="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Condizioni di contratto e termini di utilizzo</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/termini-utilizzo/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
...
I added the code you suggested, then I updated my app and flush magento cache, and reindex, but I can't display the link in admin
– Davide Iandoli
Mar 27 at 8:16
The footer of admin Magento or if your admin footer extension ?
– PЯINCƏ
Mar 27 at 8:58
the admin footer of my extension
– Davide Iandoli
Mar 27 at 9:10
ok, can you share me the layout extension content ?
– PЯINCƏ
Mar 27 at 9:12
updated question :-) Thanks
– Davide Iandoli
Mar 27 at 9:24
|
show 5 more comments
If you want to add that in admin area:
app/code/Vendor/Modulename/view/adminhtml/layout/your_layout_name.xml
<referenceContainer name="footer">
<block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="footer_blog_link" before="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Condizioni di contratto e termini di utilizzo</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/termini-utilizzo/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
...
I added the code you suggested, then I updated my app and flush magento cache, and reindex, but I can't display the link in admin
– Davide Iandoli
Mar 27 at 8:16
The footer of admin Magento or if your admin footer extension ?
– PЯINCƏ
Mar 27 at 8:58
the admin footer of my extension
– Davide Iandoli
Mar 27 at 9:10
ok, can you share me the layout extension content ?
– PЯINCƏ
Mar 27 at 9:12
updated question :-) Thanks
– Davide Iandoli
Mar 27 at 9:24
|
show 5 more comments
If you want to add that in admin area:
app/code/Vendor/Modulename/view/adminhtml/layout/your_layout_name.xml
<referenceContainer name="footer">
<block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="footer_blog_link" before="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Condizioni di contratto e termini di utilizzo</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/termini-utilizzo/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
...
If you want to add that in admin area:
app/code/Vendor/Modulename/view/adminhtml/layout/your_layout_name.xml
<referenceContainer name="footer">
<block class="MagentoFrameworkViewElementHtmlLinkCurrent" name="footer_blog_link" before="-">
<arguments>
<argument name="label" xsi:type="string" translate="true">Condizioni di contratto e termini di utilizzo</argument>
<argument name="path" xsi:type="string">https://www.fattura24.com/termini-utilizzo/</argument>
<argument name="target" xsi:type="string">_blank</argument>
</arguments>
...
answered Mar 26 at 16:35
PЯINCƏPЯINCƏ
8,41431145
8,41431145
I added the code you suggested, then I updated my app and flush magento cache, and reindex, but I can't display the link in admin
– Davide Iandoli
Mar 27 at 8:16
The footer of admin Magento or if your admin footer extension ?
– PЯINCƏ
Mar 27 at 8:58
the admin footer of my extension
– Davide Iandoli
Mar 27 at 9:10
ok, can you share me the layout extension content ?
– PЯINCƏ
Mar 27 at 9:12
updated question :-) Thanks
– Davide Iandoli
Mar 27 at 9:24
|
show 5 more comments
I added the code you suggested, then I updated my app and flush magento cache, and reindex, but I can't display the link in admin
– Davide Iandoli
Mar 27 at 8:16
The footer of admin Magento or if your admin footer extension ?
– PЯINCƏ
Mar 27 at 8:58
the admin footer of my extension
– Davide Iandoli
Mar 27 at 9:10
ok, can you share me the layout extension content ?
– PЯINCƏ
Mar 27 at 9:12
updated question :-) Thanks
– Davide Iandoli
Mar 27 at 9:24
I added the code you suggested, then I updated my app and flush magento cache, and reindex, but I can't display the link in admin
– Davide Iandoli
Mar 27 at 8:16
I added the code you suggested, then I updated my app and flush magento cache, and reindex, but I can't display the link in admin
– Davide Iandoli
Mar 27 at 8:16
The footer of admin Magento or if your admin footer extension ?
– PЯINCƏ
Mar 27 at 8:58
The footer of admin Magento or if your admin footer extension ?
– PЯINCƏ
Mar 27 at 8:58
the admin footer of my extension
– Davide Iandoli
Mar 27 at 9:10
the admin footer of my extension
– Davide Iandoli
Mar 27 at 9:10
ok, can you share me the layout extension content ?
– PЯINCƏ
Mar 27 at 9:12
ok, can you share me the layout extension content ?
– PЯINCƏ
Mar 27 at 9:12
updated question :-) Thanks
– Davide Iandoli
Mar 27 at 9:24
updated question :-) Thanks
– Davide Iandoli
Mar 27 at 9:24
|
show 5 more comments
At last I solved in this way: I edited system.xml adding code like this:
<field id="info_link" translate="label" type="button" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<frontend_model>Fattura24AppFatturazioneBlockSystemConfigInfoLink</frontend_model>
</field>
Then I created an InfoLink.php file:
<?php
namespace Fattura24AppFatturazioneBlockSystemConfig;
class InfoLink extends MagentoConfigBlockSystemConfigFormField
{
protected $_template = 'Fattura24_AppFatturazione::system/config/infoLink.phtml';
public function __construct
(
MagentoBackendBlockTemplateContext $context,
MagentoFrameworkObjectManagerInterface $objectManager,
array $data = []
)
$this->objectManager = $objectManager;
$this->storeManager = $context->getStoreManager();
parent::__construct($context, $data);
/**
* Remove scope label
*
* @param AbstractElement $element
* @return string
*/
public function render(MagentoFrameworkDataFormElementAbstractElement $element)
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
/**
* Return element html
*
* @param AbstractElement $element
* @return string
*/
protected function _getElementHtml(MagentoFrameworkDataFormElementAbstractElement $element)
return $this->_toHtml();
Eventually I added the template named infoLink.phtml:
<?php echo "<a href="https://www.fattura24.com/termini-utilizzo/" target="_blank">Condizioni di contratto e termini di utilizzo di Fattura24</a>" . "<br />";
echo "<a href="https://www.fattura24.com/regolamento-ecommerce/" target="_blank">Regolamento F24 integrativo (delle Condizioni di Contratto) per modulo Magento </a>" . "<br />";
echo "<a href="https://www.fattura24.com/policy/" target="_blank">Privacy di Fattura24</a>" . "<br />";
?>
That is working.
add a comment |
At last I solved in this way: I edited system.xml adding code like this:
<field id="info_link" translate="label" type="button" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<frontend_model>Fattura24AppFatturazioneBlockSystemConfigInfoLink</frontend_model>
</field>
Then I created an InfoLink.php file:
<?php
namespace Fattura24AppFatturazioneBlockSystemConfig;
class InfoLink extends MagentoConfigBlockSystemConfigFormField
{
protected $_template = 'Fattura24_AppFatturazione::system/config/infoLink.phtml';
public function __construct
(
MagentoBackendBlockTemplateContext $context,
MagentoFrameworkObjectManagerInterface $objectManager,
array $data = []
)
$this->objectManager = $objectManager;
$this->storeManager = $context->getStoreManager();
parent::__construct($context, $data);
/**
* Remove scope label
*
* @param AbstractElement $element
* @return string
*/
public function render(MagentoFrameworkDataFormElementAbstractElement $element)
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
/**
* Return element html
*
* @param AbstractElement $element
* @return string
*/
protected function _getElementHtml(MagentoFrameworkDataFormElementAbstractElement $element)
return $this->_toHtml();
Eventually I added the template named infoLink.phtml:
<?php echo "<a href="https://www.fattura24.com/termini-utilizzo/" target="_blank">Condizioni di contratto e termini di utilizzo di Fattura24</a>" . "<br />";
echo "<a href="https://www.fattura24.com/regolamento-ecommerce/" target="_blank">Regolamento F24 integrativo (delle Condizioni di Contratto) per modulo Magento </a>" . "<br />";
echo "<a href="https://www.fattura24.com/policy/" target="_blank">Privacy di Fattura24</a>" . "<br />";
?>
That is working.
add a comment |
At last I solved in this way: I edited system.xml adding code like this:
<field id="info_link" translate="label" type="button" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<frontend_model>Fattura24AppFatturazioneBlockSystemConfigInfoLink</frontend_model>
</field>
Then I created an InfoLink.php file:
<?php
namespace Fattura24AppFatturazioneBlockSystemConfig;
class InfoLink extends MagentoConfigBlockSystemConfigFormField
{
protected $_template = 'Fattura24_AppFatturazione::system/config/infoLink.phtml';
public function __construct
(
MagentoBackendBlockTemplateContext $context,
MagentoFrameworkObjectManagerInterface $objectManager,
array $data = []
)
$this->objectManager = $objectManager;
$this->storeManager = $context->getStoreManager();
parent::__construct($context, $data);
/**
* Remove scope label
*
* @param AbstractElement $element
* @return string
*/
public function render(MagentoFrameworkDataFormElementAbstractElement $element)
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
/**
* Return element html
*
* @param AbstractElement $element
* @return string
*/
protected function _getElementHtml(MagentoFrameworkDataFormElementAbstractElement $element)
return $this->_toHtml();
Eventually I added the template named infoLink.phtml:
<?php echo "<a href="https://www.fattura24.com/termini-utilizzo/" target="_blank">Condizioni di contratto e termini di utilizzo di Fattura24</a>" . "<br />";
echo "<a href="https://www.fattura24.com/regolamento-ecommerce/" target="_blank">Regolamento F24 integrativo (delle Condizioni di Contratto) per modulo Magento </a>" . "<br />";
echo "<a href="https://www.fattura24.com/policy/" target="_blank">Privacy di Fattura24</a>" . "<br />";
?>
That is working.
At last I solved in this way: I edited system.xml adding code like this:
<field id="info_link" translate="label" type="button" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<frontend_model>Fattura24AppFatturazioneBlockSystemConfigInfoLink</frontend_model>
</field>
Then I created an InfoLink.php file:
<?php
namespace Fattura24AppFatturazioneBlockSystemConfig;
class InfoLink extends MagentoConfigBlockSystemConfigFormField
{
protected $_template = 'Fattura24_AppFatturazione::system/config/infoLink.phtml';
public function __construct
(
MagentoBackendBlockTemplateContext $context,
MagentoFrameworkObjectManagerInterface $objectManager,
array $data = []
)
$this->objectManager = $objectManager;
$this->storeManager = $context->getStoreManager();
parent::__construct($context, $data);
/**
* Remove scope label
*
* @param AbstractElement $element
* @return string
*/
public function render(MagentoFrameworkDataFormElementAbstractElement $element)
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
/**
* Return element html
*
* @param AbstractElement $element
* @return string
*/
protected function _getElementHtml(MagentoFrameworkDataFormElementAbstractElement $element)
return $this->_toHtml();
Eventually I added the template named infoLink.phtml:
<?php echo "<a href="https://www.fattura24.com/termini-utilizzo/" target="_blank">Condizioni di contratto e termini di utilizzo di Fattura24</a>" . "<br />";
echo "<a href="https://www.fattura24.com/regolamento-ecommerce/" target="_blank">Regolamento F24 integrativo (delle Condizioni di Contratto) per modulo Magento </a>" . "<br />";
echo "<a href="https://www.fattura24.com/policy/" target="_blank">Privacy di Fattura24</a>" . "<br />";
?>
That is working.
answered Apr 5 at 9:54
Davide IandoliDavide Iandoli
63
63
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267488%2fsolved-add-external-link-in-custom-magento-plugin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Why
system.xml
? you could not add this insystem.xml
and the error confirm that. Do it instead in layout– PЯINCƏ
Mar 26 at 16:26