Magento2 : How to add custom link in footer inside newsletter block?

Clash Royale CLAN TAG#URR8PPP
To add custom link in newsletter block magento 2 ??
magento2 footer
add a comment |
To add custom link in newsletter block magento 2 ??
magento2 footer
add a comment |
To add custom link in newsletter block magento 2 ??
magento2 footer
To add custom link in newsletter block magento 2 ??
magento2 footer
magento2 footer
edited Mar 5 at 12:33
Amit Naraniwal
1
1
asked Mar 5 at 12:08
GomathiGomathi
757
757
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
For add custom link in footer inside newsletter block.You Need to override these file in your custom theme
vendor/magento/module-newsletter/view/frontend/templates/subscribe.phtml.
like this one
app/design/frontend/PackageName/ThemeName/Magento_Newsletter/templates/subscribe.phtml
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/** @var MagentoNewsletterBlockSubscribe $block */
?>
<div class="block newsletter">
<div class="title">
<strong>
<?= $block->escapeHtml(__('Newsletter')) ?>
</strong>
</div>
<div class="content">
<form class="form subscribe"
novalidate
action="<?= $block->escapeUrl($block->getFormActionUrl()) ?>"
method="post"
data-mage-init='"validation": "errorClass": "mage-error"'
id="newsletter-validate-detail">
<div class="field newsletter">
<a href ="link">link</a>
<label class="label" for="newsletter"><span><?= $block->escapeHtml(__('Sign Up for sneak peaks and sales!')) ?></span></label>
<div class="control">
<input name="email" type="email" id="newsletter"
placeholder="<?= $block->escapeHtmlAttr(__('Enter your email')) ?>"
data-validate="required:true, 'validate-email':true"/>
</div>
</div>
<div class="actions">
<button id="subscribe-button-click" class="action subscribe primary" title="<?= $block->escapeHtmlAttr(__('Subscribe')) ?>" type="submit">
<span><?= $block->escapeHtml(__('Subscribe')) ?></span>
</button>
</div>
</form>
</div>
</div>
You Add Link Whenever you want in subscribe block as per your html. i have add a link before the newsletter block.PLease check and let me know in case of any issue.
add a comment |
you can override below file in your theme and update footer container also add custom link
<?xml version="1.0"?>
<page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body>
<referenceContainer name="footer">
<referenceBlock name="form.subscribe">
<block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/>
<block class="MagentoFrameworkViewElementHtmlLink" name="custom-link">
<arguments>
<argument name="label" xsi:type="string">Custom Link</argument>
<!-- This will be displayed as the label of the link -->
<argument name="path" xsi:type="string">path/to/page</argument>
<!-- here give the path where the link redirect to -->
</arguments>
</block>
</referenceBlock>
</referenceContainer>
</body>
</page>
<?xml version="1.0"?> <page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="footer"> <referenceBlock name="form.subscribe"> <block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/> </referenceBlock> </referenceContainer> </body> </page>
– Gomathi
Mar 5 at 12:26
i want to add link inside newsletter block in app/code itself
– Gomathi
Mar 5 at 12:27
i have added first code this code worked code
– Rakesh Donga
Mar 5 at 12:29
Let me know if you have any confusion for implementation.
– Rakesh Donga
Mar 5 at 12:31
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
Mar 5 at 12:33
|
show 3 more comments
In order to call links and custom block in footer in magento 2.
So, the file which is used to define configurations of footer is default.xml. This file will be located under app/code/Namespace/Module/view/frontend/layout/. This file calls on every page, that’s why we write code for footer in this file.
Below code is used to call custom links in footer :
<referenceBlock name="footer_links">
<block class="MagentoFrameworkViewElementHtmlLink" name="custom-link">
<arguments>
<argument name="label" xsi:type="string">Custom Link</argument>
<!-- This will be displayed as the label of the link -->
<argument name="path" xsi:type="string">path/to/page</argument>
<!-- here give the path where the link redirect to -->
</arguments>
</block>
</referenceBlock>
Now If you want to add your own custom block and template inside the footer,
then below code will be used :
<referenceContainer name="footer-container">
<block class="MagentoThemeBlockHtmlFooter" name="custom_block" as="custom_block" template="custom.phtml"/>
</referenceContainer>
add a comment |
Copy subscribe.phtml file form
vendor/magento/module-newsletter/view/frontend/templates/
and paste to you custom theme at following location
app/design/frontend/<vendor name>/<theme name>/Magento_Newsletter/templates/
Now add custom link to subscribe.phtml file
I hope this will help you
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%2f264485%2fmagento2-how-to-add-custom-link-in-footer-inside-newsletter-block%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
For add custom link in footer inside newsletter block.You Need to override these file in your custom theme
vendor/magento/module-newsletter/view/frontend/templates/subscribe.phtml.
like this one
app/design/frontend/PackageName/ThemeName/Magento_Newsletter/templates/subscribe.phtml
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/** @var MagentoNewsletterBlockSubscribe $block */
?>
<div class="block newsletter">
<div class="title">
<strong>
<?= $block->escapeHtml(__('Newsletter')) ?>
</strong>
</div>
<div class="content">
<form class="form subscribe"
novalidate
action="<?= $block->escapeUrl($block->getFormActionUrl()) ?>"
method="post"
data-mage-init='"validation": "errorClass": "mage-error"'
id="newsletter-validate-detail">
<div class="field newsletter">
<a href ="link">link</a>
<label class="label" for="newsletter"><span><?= $block->escapeHtml(__('Sign Up for sneak peaks and sales!')) ?></span></label>
<div class="control">
<input name="email" type="email" id="newsletter"
placeholder="<?= $block->escapeHtmlAttr(__('Enter your email')) ?>"
data-validate="required:true, 'validate-email':true"/>
</div>
</div>
<div class="actions">
<button id="subscribe-button-click" class="action subscribe primary" title="<?= $block->escapeHtmlAttr(__('Subscribe')) ?>" type="submit">
<span><?= $block->escapeHtml(__('Subscribe')) ?></span>
</button>
</div>
</form>
</div>
</div>
You Add Link Whenever you want in subscribe block as per your html. i have add a link before the newsletter block.PLease check and let me know in case of any issue.
add a comment |
For add custom link in footer inside newsletter block.You Need to override these file in your custom theme
vendor/magento/module-newsletter/view/frontend/templates/subscribe.phtml.
like this one
app/design/frontend/PackageName/ThemeName/Magento_Newsletter/templates/subscribe.phtml
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/** @var MagentoNewsletterBlockSubscribe $block */
?>
<div class="block newsletter">
<div class="title">
<strong>
<?= $block->escapeHtml(__('Newsletter')) ?>
</strong>
</div>
<div class="content">
<form class="form subscribe"
novalidate
action="<?= $block->escapeUrl($block->getFormActionUrl()) ?>"
method="post"
data-mage-init='"validation": "errorClass": "mage-error"'
id="newsletter-validate-detail">
<div class="field newsletter">
<a href ="link">link</a>
<label class="label" for="newsletter"><span><?= $block->escapeHtml(__('Sign Up for sneak peaks and sales!')) ?></span></label>
<div class="control">
<input name="email" type="email" id="newsletter"
placeholder="<?= $block->escapeHtmlAttr(__('Enter your email')) ?>"
data-validate="required:true, 'validate-email':true"/>
</div>
</div>
<div class="actions">
<button id="subscribe-button-click" class="action subscribe primary" title="<?= $block->escapeHtmlAttr(__('Subscribe')) ?>" type="submit">
<span><?= $block->escapeHtml(__('Subscribe')) ?></span>
</button>
</div>
</form>
</div>
</div>
You Add Link Whenever you want in subscribe block as per your html. i have add a link before the newsletter block.PLease check and let me know in case of any issue.
add a comment |
For add custom link in footer inside newsletter block.You Need to override these file in your custom theme
vendor/magento/module-newsletter/view/frontend/templates/subscribe.phtml.
like this one
app/design/frontend/PackageName/ThemeName/Magento_Newsletter/templates/subscribe.phtml
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/** @var MagentoNewsletterBlockSubscribe $block */
?>
<div class="block newsletter">
<div class="title">
<strong>
<?= $block->escapeHtml(__('Newsletter')) ?>
</strong>
</div>
<div class="content">
<form class="form subscribe"
novalidate
action="<?= $block->escapeUrl($block->getFormActionUrl()) ?>"
method="post"
data-mage-init='"validation": "errorClass": "mage-error"'
id="newsletter-validate-detail">
<div class="field newsletter">
<a href ="link">link</a>
<label class="label" for="newsletter"><span><?= $block->escapeHtml(__('Sign Up for sneak peaks and sales!')) ?></span></label>
<div class="control">
<input name="email" type="email" id="newsletter"
placeholder="<?= $block->escapeHtmlAttr(__('Enter your email')) ?>"
data-validate="required:true, 'validate-email':true"/>
</div>
</div>
<div class="actions">
<button id="subscribe-button-click" class="action subscribe primary" title="<?= $block->escapeHtmlAttr(__('Subscribe')) ?>" type="submit">
<span><?= $block->escapeHtml(__('Subscribe')) ?></span>
</button>
</div>
</form>
</div>
</div>
You Add Link Whenever you want in subscribe block as per your html. i have add a link before the newsletter block.PLease check and let me know in case of any issue.
For add custom link in footer inside newsletter block.You Need to override these file in your custom theme
vendor/magento/module-newsletter/view/frontend/templates/subscribe.phtml.
like this one
app/design/frontend/PackageName/ThemeName/Magento_Newsletter/templates/subscribe.phtml
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/** @var MagentoNewsletterBlockSubscribe $block */
?>
<div class="block newsletter">
<div class="title">
<strong>
<?= $block->escapeHtml(__('Newsletter')) ?>
</strong>
</div>
<div class="content">
<form class="form subscribe"
novalidate
action="<?= $block->escapeUrl($block->getFormActionUrl()) ?>"
method="post"
data-mage-init='"validation": "errorClass": "mage-error"'
id="newsletter-validate-detail">
<div class="field newsletter">
<a href ="link">link</a>
<label class="label" for="newsletter"><span><?= $block->escapeHtml(__('Sign Up for sneak peaks and sales!')) ?></span></label>
<div class="control">
<input name="email" type="email" id="newsletter"
placeholder="<?= $block->escapeHtmlAttr(__('Enter your email')) ?>"
data-validate="required:true, 'validate-email':true"/>
</div>
</div>
<div class="actions">
<button id="subscribe-button-click" class="action subscribe primary" title="<?= $block->escapeHtmlAttr(__('Subscribe')) ?>" type="submit">
<span><?= $block->escapeHtml(__('Subscribe')) ?></span>
</button>
</div>
</form>
</div>
</div>
You Add Link Whenever you want in subscribe block as per your html. i have add a link before the newsletter block.PLease check and let me know in case of any issue.
edited Mar 8 at 12:10
answered Mar 5 at 12:19
Magento_BhurioMagento_Bhurio
333110
333110
add a comment |
add a comment |
you can override below file in your theme and update footer container also add custom link
<?xml version="1.0"?>
<page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body>
<referenceContainer name="footer">
<referenceBlock name="form.subscribe">
<block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/>
<block class="MagentoFrameworkViewElementHtmlLink" name="custom-link">
<arguments>
<argument name="label" xsi:type="string">Custom Link</argument>
<!-- This will be displayed as the label of the link -->
<argument name="path" xsi:type="string">path/to/page</argument>
<!-- here give the path where the link redirect to -->
</arguments>
</block>
</referenceBlock>
</referenceContainer>
</body>
</page>
<?xml version="1.0"?> <page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="footer"> <referenceBlock name="form.subscribe"> <block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/> </referenceBlock> </referenceContainer> </body> </page>
– Gomathi
Mar 5 at 12:26
i want to add link inside newsletter block in app/code itself
– Gomathi
Mar 5 at 12:27
i have added first code this code worked code
– Rakesh Donga
Mar 5 at 12:29
Let me know if you have any confusion for implementation.
– Rakesh Donga
Mar 5 at 12:31
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
Mar 5 at 12:33
|
show 3 more comments
you can override below file in your theme and update footer container also add custom link
<?xml version="1.0"?>
<page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body>
<referenceContainer name="footer">
<referenceBlock name="form.subscribe">
<block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/>
<block class="MagentoFrameworkViewElementHtmlLink" name="custom-link">
<arguments>
<argument name="label" xsi:type="string">Custom Link</argument>
<!-- This will be displayed as the label of the link -->
<argument name="path" xsi:type="string">path/to/page</argument>
<!-- here give the path where the link redirect to -->
</arguments>
</block>
</referenceBlock>
</referenceContainer>
</body>
</page>
<?xml version="1.0"?> <page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="footer"> <referenceBlock name="form.subscribe"> <block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/> </referenceBlock> </referenceContainer> </body> </page>
– Gomathi
Mar 5 at 12:26
i want to add link inside newsletter block in app/code itself
– Gomathi
Mar 5 at 12:27
i have added first code this code worked code
– Rakesh Donga
Mar 5 at 12:29
Let me know if you have any confusion for implementation.
– Rakesh Donga
Mar 5 at 12:31
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
Mar 5 at 12:33
|
show 3 more comments
you can override below file in your theme and update footer container also add custom link
<?xml version="1.0"?>
<page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body>
<referenceContainer name="footer">
<referenceBlock name="form.subscribe">
<block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/>
<block class="MagentoFrameworkViewElementHtmlLink" name="custom-link">
<arguments>
<argument name="label" xsi:type="string">Custom Link</argument>
<!-- This will be displayed as the label of the link -->
<argument name="path" xsi:type="string">path/to/page</argument>
<!-- here give the path where the link redirect to -->
</arguments>
</block>
</referenceBlock>
</referenceContainer>
</body>
</page>
you can override below file in your theme and update footer container also add custom link
<?xml version="1.0"?>
<page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body>
<referenceContainer name="footer">
<referenceBlock name="form.subscribe">
<block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/>
<block class="MagentoFrameworkViewElementHtmlLink" name="custom-link">
<arguments>
<argument name="label" xsi:type="string">Custom Link</argument>
<!-- This will be displayed as the label of the link -->
<argument name="path" xsi:type="string">path/to/page</argument>
<!-- here give the path where the link redirect to -->
</arguments>
</block>
</referenceBlock>
</referenceContainer>
</body>
</page>
edited Mar 5 at 12:47
answered Mar 5 at 12:13
Rakesh DongaRakesh Donga
2,368316
2,368316
<?xml version="1.0"?> <page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="footer"> <referenceBlock name="form.subscribe"> <block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/> </referenceBlock> </referenceContainer> </body> </page>
– Gomathi
Mar 5 at 12:26
i want to add link inside newsletter block in app/code itself
– Gomathi
Mar 5 at 12:27
i have added first code this code worked code
– Rakesh Donga
Mar 5 at 12:29
Let me know if you have any confusion for implementation.
– Rakesh Donga
Mar 5 at 12:31
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
Mar 5 at 12:33
|
show 3 more comments
<?xml version="1.0"?> <page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="footer"> <referenceBlock name="form.subscribe"> <block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/> </referenceBlock> </referenceContainer> </body> </page>
– Gomathi
Mar 5 at 12:26
i want to add link inside newsletter block in app/code itself
– Gomathi
Mar 5 at 12:27
i have added first code this code worked code
– Rakesh Donga
Mar 5 at 12:29
Let me know if you have any confusion for implementation.
– Rakesh Donga
Mar 5 at 12:31
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
Mar 5 at 12:33
<?xml version="1.0"?> <page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="footer"> <referenceBlock name="form.subscribe"> <block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/> </referenceBlock> </referenceContainer> </body> </page>
– Gomathi
Mar 5 at 12:26
<?xml version="1.0"?> <page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="footer"> <referenceBlock name="form.subscribe"> <block class="vendormoduleBlockNavigationCustomer" after="-" name="vendor_accountr_footer" template="footer/custom.phtml"/> </referenceBlock> </referenceContainer> </body> </page>
– Gomathi
Mar 5 at 12:26
i want to add link inside newsletter block in app/code itself
– Gomathi
Mar 5 at 12:27
i want to add link inside newsletter block in app/code itself
– Gomathi
Mar 5 at 12:27
i have added first code this code worked code
– Rakesh Donga
Mar 5 at 12:29
i have added first code this code worked code
– Rakesh Donga
Mar 5 at 12:29
Let me know if you have any confusion for implementation.
– Rakesh Donga
Mar 5 at 12:31
Let me know if you have any confusion for implementation.
– Rakesh Donga
Mar 5 at 12:31
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
Mar 5 at 12:33
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
Mar 5 at 12:33
|
show 3 more comments
In order to call links and custom block in footer in magento 2.
So, the file which is used to define configurations of footer is default.xml. This file will be located under app/code/Namespace/Module/view/frontend/layout/. This file calls on every page, that’s why we write code for footer in this file.
Below code is used to call custom links in footer :
<referenceBlock name="footer_links">
<block class="MagentoFrameworkViewElementHtmlLink" name="custom-link">
<arguments>
<argument name="label" xsi:type="string">Custom Link</argument>
<!-- This will be displayed as the label of the link -->
<argument name="path" xsi:type="string">path/to/page</argument>
<!-- here give the path where the link redirect to -->
</arguments>
</block>
</referenceBlock>
Now If you want to add your own custom block and template inside the footer,
then below code will be used :
<referenceContainer name="footer-container">
<block class="MagentoThemeBlockHtmlFooter" name="custom_block" as="custom_block" template="custom.phtml"/>
</referenceContainer>
add a comment |
In order to call links and custom block in footer in magento 2.
So, the file which is used to define configurations of footer is default.xml. This file will be located under app/code/Namespace/Module/view/frontend/layout/. This file calls on every page, that’s why we write code for footer in this file.
Below code is used to call custom links in footer :
<referenceBlock name="footer_links">
<block class="MagentoFrameworkViewElementHtmlLink" name="custom-link">
<arguments>
<argument name="label" xsi:type="string">Custom Link</argument>
<!-- This will be displayed as the label of the link -->
<argument name="path" xsi:type="string">path/to/page</argument>
<!-- here give the path where the link redirect to -->
</arguments>
</block>
</referenceBlock>
Now If you want to add your own custom block and template inside the footer,
then below code will be used :
<referenceContainer name="footer-container">
<block class="MagentoThemeBlockHtmlFooter" name="custom_block" as="custom_block" template="custom.phtml"/>
</referenceContainer>
add a comment |
In order to call links and custom block in footer in magento 2.
So, the file which is used to define configurations of footer is default.xml. This file will be located under app/code/Namespace/Module/view/frontend/layout/. This file calls on every page, that’s why we write code for footer in this file.
Below code is used to call custom links in footer :
<referenceBlock name="footer_links">
<block class="MagentoFrameworkViewElementHtmlLink" name="custom-link">
<arguments>
<argument name="label" xsi:type="string">Custom Link</argument>
<!-- This will be displayed as the label of the link -->
<argument name="path" xsi:type="string">path/to/page</argument>
<!-- here give the path where the link redirect to -->
</arguments>
</block>
</referenceBlock>
Now If you want to add your own custom block and template inside the footer,
then below code will be used :
<referenceContainer name="footer-container">
<block class="MagentoThemeBlockHtmlFooter" name="custom_block" as="custom_block" template="custom.phtml"/>
</referenceContainer>
In order to call links and custom block in footer in magento 2.
So, the file which is used to define configurations of footer is default.xml. This file will be located under app/code/Namespace/Module/view/frontend/layout/. This file calls on every page, that’s why we write code for footer in this file.
Below code is used to call custom links in footer :
<referenceBlock name="footer_links">
<block class="MagentoFrameworkViewElementHtmlLink" name="custom-link">
<arguments>
<argument name="label" xsi:type="string">Custom Link</argument>
<!-- This will be displayed as the label of the link -->
<argument name="path" xsi:type="string">path/to/page</argument>
<!-- here give the path where the link redirect to -->
</arguments>
</block>
</referenceBlock>
Now If you want to add your own custom block and template inside the footer,
then below code will be used :
<referenceContainer name="footer-container">
<block class="MagentoThemeBlockHtmlFooter" name="custom_block" as="custom_block" template="custom.phtml"/>
</referenceContainer>
answered Mar 5 at 12:12
Muhammad HashamMuhammad Hasham
2,7312831
2,7312831
add a comment |
add a comment |
Copy subscribe.phtml file form
vendor/magento/module-newsletter/view/frontend/templates/
and paste to you custom theme at following location
app/design/frontend/<vendor name>/<theme name>/Magento_Newsletter/templates/
Now add custom link to subscribe.phtml file
I hope this will help you
add a comment |
Copy subscribe.phtml file form
vendor/magento/module-newsletter/view/frontend/templates/
and paste to you custom theme at following location
app/design/frontend/<vendor name>/<theme name>/Magento_Newsletter/templates/
Now add custom link to subscribe.phtml file
I hope this will help you
add a comment |
Copy subscribe.phtml file form
vendor/magento/module-newsletter/view/frontend/templates/
and paste to you custom theme at following location
app/design/frontend/<vendor name>/<theme name>/Magento_Newsletter/templates/
Now add custom link to subscribe.phtml file
I hope this will help you
Copy subscribe.phtml file form
vendor/magento/module-newsletter/view/frontend/templates/
and paste to you custom theme at following location
app/design/frontend/<vendor name>/<theme name>/Magento_Newsletter/templates/
Now add custom link to subscribe.phtml file
I hope this will help you
answered Mar 5 at 12:13
user55548user55548
33129
33129
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%2f264485%2fmagento2-how-to-add-custom-link-in-footer-inside-newsletter-block%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