3

This question already has an answer here:

I am trying to override an html file in the lib folder, but I cant get it to work. Here is what I have so far:

Path to file I want to override: /lib/web/mage/gallery/gallery.html

Path to file I want to override with: /app/design/frontend/{Module}/{Theme}/web/mage/gallery/gallery.html

I have flushed the cache, but it still only loads the original file.

Any help with this would be appreciated.

Update: If I delete the lib files, it will use the files I want to use, but I want to override the lib files, not have to delete them.

marked as duplicate by Khoa TruongDinh magento2 May 30 at 1:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Need to disable Browser cache or try to use Incognito mode. – Khoa TruongDinh May 30 at 1:28
1

I think you missed something with clearing cache.

Copy file to

 /app/design/frontend/<vendor>/<theme>/web/mage/gallery/gallery.html
  1. Clear cache and delete pub/static/frontend

  2. Deploy static content (if you in production mode)

  3. Clear browser cache.

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