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












1















To add custom link in newsletter block magento 2 ??enter image description here










share|improve this question





























    1















    To add custom link in newsletter block magento 2 ??enter image description here










    share|improve this question



























      1












      1








      1








      To add custom link in newsletter block magento 2 ??enter image description here










      share|improve this question
















      To add custom link in newsletter block magento 2 ??enter image description here







      magento2 footer






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 13 hours ago









      Amit Naraniwal

      65239




      65239










      asked 13 hours ago









      GomathiGomathi

      587




      587






















          4 Answers
          4






          active

          oldest

          votes


















          1














          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.






          share|improve this answer

































            1














            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>





            share|improve this answer


























            • <?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



















            0














            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>





            share|improve this answer































              0














              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






              share|improve this answer























                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
                });


                }
                });














                draft saved

                draft discarded


















                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









                1














                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.






                share|improve this answer






























                  1














                  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.






                  share|improve this answer




























                    1












                    1








                    1







                    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.






                    share|improve this answer















                    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.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited 13 hours ago

























                    answered 13 hours ago









                    Magento_BhurioMagento_Bhurio

                    957




                    957

























                        1














                        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>





                        share|improve this answer


























                        • <?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
















                        1














                        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>





                        share|improve this answer


























                        • <?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














                        1












                        1








                        1







                        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>





                        share|improve this answer















                        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>






                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        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



















                        • <?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











                        0














                        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>





                        share|improve this answer




























                          0














                          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>





                          share|improve this answer


























                            0












                            0








                            0







                            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>





                            share|improve this answer













                            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>






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 13 hours ago









                            Muhammad HashamMuhammad Hasham

                            2,0961529




                            2,0961529























                                0














                                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






                                share|improve this answer




























                                  0














                                  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






                                  share|improve this answer


























                                    0












                                    0








                                    0







                                    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






                                    share|improve this answer













                                    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







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered 13 hours ago









                                    user55548user55548

                                    27629




                                    27629






























                                        draft saved

                                        draft discarded




















































                                        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.




                                        draft saved


                                        draft discarded














                                        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





















































                                        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







                                        Popular posts from this blog

                                        香粉寮

                                        GameSpot