0

I created the modified default.xml and created headerContent.phtml to add new content to the header panel to be position on the opposite side of the login and welcome msg. However, after uploading, modifying and clearing all caches, my new content isn't showing up on the page at all.

Vendor/Theme_name/Magento_Theme/layout/default.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="header.panel">
            <block class="Magento\Framework\View\Element\Template" name="header.content" template="Magento_Theme::headerContent.phtml" before="header.links" />
        </referenceContainer>    
    </body>
</page>

Vendor/Theme_name/Magento_Theme/templates/headerContent.phtml

Hello World!

What am i doing wrong? did i use the wrong location or a typo somewhere?

  • modified to change /templates/html/ to /templates/ - mistyped the folder directory – Blitzo Aug 21 '17 at 11:21
0

You have missed out html in the template path.

So change

template="Magento_Theme::headerContent.phtml"

To

template="Magento_Theme::html/headerContent.phtml"
  • thank you for your reply. i will adjust its just in templates not templates/html. my mistake. any other errors other than that? it didnt work for me. – Blitzo Aug 21 '17 at 11:17
  • Not that I can see, have you cleared caches? – Ben Crook Aug 21 '17 at 12:20
  • I don't think it matters but Magento don't use camel case for template names, you could try changing headerContent to header_content and see if that makes a difference. Again clear Magento cache after making that change – Ben Crook Aug 21 '17 at 12:25
  • thanks. I changed it to header_content. definitely flushed and cleared caches. still a no go. not sure why. not responding at all. – Blitzo Aug 22 '17 at 8:23
  • do i have to redeploy the theme for it to take effect? thats the only thing i didnt do. – Blitzo Aug 23 '17 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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