0

For my online store I want use Luma theme and in priciple all good, but I need modify little structure, I need below menu add custom links list (which will be displayed on all pages) - I have .phtm file with my hardcode structure, I want to place it here: https://prnt.sc/1106w4z and above footer I need add my location stores - also hardcode in .phtml and need to place here: https://prnt.sc/1106wgr.

After reading on the forum, I saw that you can use the default.xml for this, but how should this file look correctly where can I connect my .phtml files to display in under the header and footer.

Thank you.

1 Answer 1

1

This can be done from layout. I would suggest to create a child theme based on "Luma Theme" for this. Learn how to create child theme here:

  1. https://meetanshi.com/blog/create-child-theme-in-magento-2/
  2. https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-inherit.html

After that:

Create a file app/design/frontend/your_theme/theme_name/Magento_Theme/layout/default.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="page.top">
            <block class="Magento\Framework\View\Element\Template" name="your.unique.name" template="Magento_Theme::html/my-template.phtml" before="top.container" />
        </referenceContainer>
    </body>
</page>

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.