1

I'm trying to override theme files in my custom theme based on the blank theme.

I managed to override the css with a custom css file. So i know my path correct. This path is:

<Vendor>/<Theme>/Magento_Theme/layout/default_head_blocks.xml 

When i try to override the header.phtml nothing changes. I tried both urls:

<Vendor>/<Theme>/Magento_Theme/template/html/header.phtml <Vendor>/<Theme>/Magento_Theme/templates/html/header.phtml 

Both files are not picked up by the compiler or whatever blocks the rendering.

I'm in developer mode and I'm using the Bitnami magento 2 from google cloud launcher.

Am I missing something badly here?

6
  • can you check : blog.qaisarsatti.com/magento_2/… Commented Jun 19, 2018 at 12:53
  • Are you override file in App->design or in your custom module? Commented Jun 19, 2018 at 12:56
  • @PrashantPatel My path is exactly the same as the one stated in the tutorial: app/design/frontend/Wavelabs/afterparty/Magento_Theme/templates/html/header.phtml Commented Jun 19, 2018 at 13:07
  • @ChiragPatel i'm using app->design Commented Jun 19, 2018 at 13:07
  • May be it is possible to already override in other module or somewhere. otherwise if your folder structure and path is right then it must reflect. Commented Jun 19, 2018 at 13:10

1 Answer 1

1

Just some suggestions:

Even in developer mode cache can be turned on, so in this case you should run bin/magento cache:flush after you make changes or turn it off.

Sometimes you need to click Flush Static Files button in admin->sytem->cache management, as it seems like bin/magento cache:flush doesn't do this.

I am new to magento but as i understand magento doesn't override templates, it extends them instead so maybe you have your changes in markup but you dont see them in browser.

2
  • THANK YOU. I managed to fix the issue. I flushed the static files, removed everything under view_preprocessed and did bin/magento setup:static-content:deploy. Weird that i had to do this even in developer mode... Even after that it sometimes takes 2 flushes before it appears in my browser... Commented Jun 20, 2018 at 8:10
  • 1
    Just noticed that you use Bitnami, as far as i remember it has opcache turned on, so you better check it in php.ini file and turn off for develop purposes (use search in file by string opcache.enable= it should be opcache.enable=0 or commented out). Commented Jun 20, 2018 at 15:55

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.