Magento2 : How to add custom link in footer inside newsletter block?
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 13 hours ago
Amit Naraniwal
65239
65239
asked 13 hours ago
GomathiGomathi
587
587
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/Magento/project/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
13 hours ago
i want to add link inside newsletter block in app/code itself
– Gomathi
13 hours ago
i have added first code this code worked code
– Rakesh Donga
13 hours ago
Let me know if you have any confusion for implementation.
– Rakesh Donga
13 hours ago
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
13 hours ago
|
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/Magento/project/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/Magento/project/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/Magento/project/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/Magento/project/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 13 hours ago
answered 13 hours ago
Magento_BhurioMagento_Bhurio
957
957
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
13 hours ago
i want to add link inside newsletter block in app/code itself
– Gomathi
13 hours ago
i have added first code this code worked code
– Rakesh Donga
13 hours ago
Let me know if you have any confusion for implementation.
– Rakesh Donga
13 hours ago
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
13 hours ago
|
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
13 hours ago
i want to add link inside newsletter block in app/code itself
– Gomathi
13 hours ago
i have added first code this code worked code
– Rakesh Donga
13 hours ago
Let me know if you have any confusion for implementation.
– Rakesh Donga
13 hours ago
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
13 hours ago
|
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 12 hours ago
answered 13 hours ago
Rakesh DongaRakesh Donga
1,501316
1,501316
<?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
13 hours ago
i want to add link inside newsletter block in app/code itself
– Gomathi
13 hours ago
i have added first code this code worked code
– Rakesh Donga
13 hours ago
Let me know if you have any confusion for implementation.
– Rakesh Donga
13 hours ago
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
13 hours ago
|
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
13 hours ago
i want to add link inside newsletter block in app/code itself
– Gomathi
13 hours ago
i have added first code this code worked code
– Rakesh Donga
13 hours ago
Let me know if you have any confusion for implementation.
– Rakesh Donga
13 hours ago
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
13 hours ago
<?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
13 hours ago
<?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
13 hours ago
i want to add link inside newsletter block in app/code itself
– Gomathi
13 hours ago
i want to add link inside newsletter block in app/code itself
– Gomathi
13 hours ago
i have added first code this code worked code
– Rakesh Donga
13 hours ago
i have added first code this code worked code
– Rakesh Donga
13 hours ago
Let me know if you have any confusion for implementation.
– Rakesh Donga
13 hours ago
Let me know if you have any confusion for implementation.
– Rakesh Donga
13 hours ago
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
13 hours ago
actually i dnt want to override template through design , just from code itself i need to add link inside newsletter block
– Gomathi
13 hours ago
|
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 13 hours ago
Muhammad HashamMuhammad Hasham
2,0961529
2,0961529
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 13 hours ago
user55548user55548
27629
27629
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