1

Using Magento2, version 2.19

We are editing below file:

app/design/frontend/xx/xxxxx/Magento_Newsletter/templates/subscribe_popup.phtml

How can I show the changes to this file in the frontend of the site, without having to redeploy the static files from command line every time?

2

Yeah this can be done from within the below folder:

var/view_preprocessed/pub/static/app/design/frontend/vendor/theme

Modify the file within there and it will update instantly after a cache flush to remove any static block cache's or full page caches that the changes may also be stuck within. It's also worth updating the original files so they are not overwritten to the originals at any later static content deployment.

0

You don't need to run the setup:static-content:deploy commamd every time to show the changes of phtml file. If your theme is perfectly created and the cache is refreshed successfully, then your changes will be displayed in the frontend.

  • Ok, but they're not..... the file is being edited in the location detailed above. Cache is being cleared in normal fashion. So why are changes not appearing in frontend? I can only get the changes to occur is static content is redeployed as I say. – MagentoMac Nov 9 '17 at 19:17
  • Updated question to detail we are using Magento version 2, not Magento1!! Fairly obvious thing I forgot to mention.... long day.... should also have mentioned we have JS and CSS minified. Is that causing the issue? My understanding for Magento2 is that the files need to be edited in the /pub folder. If in app/design folder, then they need to be redeployed to be updated in frontend? – MagentoMac Nov 9 '17 at 19:21
  • Pub folder only consists css, images, js and fonts files. You need to run deploy command if only you add or edit css,js,images or fonts in app/design folder. If you are editing only phtml file then it doesn't need to run deploy command – user60655 Nov 9 '17 at 19:24
  • Ok, so in this example, I am only editing the subscribe_popup.phtml file, so why is the frontend not updating after clearing cache? It's a theme file, not Magento core file. Tried clearing cache via Magento admin, and deleting cache folder in /var folder, but no change in frontend like I say – MagentoMac Nov 9 '17 at 19:32
  • This isn't the answer to this question and the question really still needs an answer. Have searched similar questions in this network, but nobody asking the exact same question and no answer out there as far as I can see. I think you need to redeploy the static content, but would like an answer either way to confirm from somebody who is 100% sure and can maybe even explain why? – MagentoMac Nov 10 '17 at 16:43

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.