1

I have tried to add a h3 header to the footer links block using the approach outlined here:

Adding title to cms footer block

This looks difficult to maintain and it wasn't quite what I wanted.

I can add a static block with my own links and probably get an easier to maintain solution, however, I would prefer to do it the Magento2 way.

It is possible to specify a template for the links block and I can do this but not be able to pull through the actual links.

        <referenceBlock name="footer_links">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Magento_Theme::html/custom.phtml</argument>
        </action>
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="glossary">
            <arguments>
                <argument name="label" xsi:type="string">Delivery and returns</argument>
                <argument name="path" xsi:type="string">delivery-information</argument>
            </arguments>
        </block>
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="deliveryinfo">
            <arguments>
                <argument name="label" xsi:type="string">Glossary</argument>
                <argument name="path" xsi:type="string">glossary</argument>
            </arguments>
        </block>
    </referenceBlock>

Can anyone help with an elegant solution to this?

1

1 Answer 1

0

Just add a text block in default.xml:

    <referenceBlock name="footer_links">
        <block class="Magento\Framework\View\Element\Text" name="footer_links_title" before="-">
            <arguments>
                <argument translate="true" name="text" xsi:type="string">
                    <![CDATA[<h3>More in this store</h3>]]>
                </argument>
            </arguments>
        </block>
    </referenceBlock>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.