0

I am new and learn Magento 2. I am creating my new custom theme in Magento 2 and integrated my HTML and CSS.HTML is not showing on my page but CSS work How I apply HTML in my theme and modify my themeenter image description here

this is my theme Structure

1
  • have you tried cache flush and static content deploy?
    – kunj
    Commented May 17, 2018 at 6:57

2 Answers 2

0

You will likely need to flush the cache, these are the 2 most commons ways to do so:

  1. In the terminal navigate to the folder where Magento is installed and run php bin magento cache:flush

or

  1. Login to the admin and navigate to system > cache management and click on Flush Magento Cache
1
  • I already clear my cache but my HTML file is not see Commented May 17, 2018 at 10:06
0

In order for your custom HTML to render, you must declare the page reference in XML. So assuming your parent theme is Luma: in your layout/default.xml file you need to declare something similar to:

<referenceContainer name="header.panel">
        <block class="Magento\Framework\View\Element\Template" name="custom_header" template="html/header.phtml" before="-">
</referenceContainer>

Further reading: https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/layouts/xml-instructions.html

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.