0

I have updated the file and added some text to:

app/code/Magento/Theme/view/frontend/templates/html/header.phtml

I have checked the website and nothing is reflecting on the site. I have cleared my cache in my browser and cookies. I have ran all of these commands too with successful message feedback yet still nothing on the front end.

# php bin/magento setup:static-content:deploy
# grunt deploy
# bin/magento deploy:mode:show

1 Answer 1

2

You don't "deploy" PHTML files. They are referenced by blocks in layout files and processed on the server side. So "grunt" is not relevant here, and the static content deployment is similarly not relevant.

Have you gone into the Admin panel, Cache Management, and clicked the "Flush Magento Cache" button there? I suspect it is cached in the page cache.

The other possibility (I have not checked) is something has overriden the default head.phtml file, so the file you are editing is not being loaded. There are "hints" you can turn on which I think report the file name being used for each block.

To enable template hits, go to the Admin interface and navigate to “Stores” / “Configuration” in the menu. Then pick “Main Website” from the “Store View” drop down (this is as an important step that is often missed). Scroll down to “Advanced” / “Developer” in the left hand side accordion menu. Expand the “Debug” section in the main content area to make and save changes. Set “Template Path Hints” to “Yes” to display the paths for template files. (The output is pretty ugly, but it contains the required information to work out what PHTML file is being loaded. Try "view source" if too hard to read.)

Your Answer

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

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