Search code examples
cdnbigcommerce

How to use image from WebDev of BigCommerce in theme file?


How to add dynamic cdn url for BigCommerce Web Dev file?

Added this:

<img src="https://cdn11.bigcommerce.com/s-xw5rimf0vt/content/carousel/1920x600-3.jpg" width="1920" height="600">

I want to add dynamic CDN url like this but not working.

<img src="{{cdn 'content/carousel/1920x600-3.jpg'}}" width="1920" height="600">

For access assests folder of theme file this below url is working <img src="{{cdn 'assets/carousel/1920x600-3.jpg'}}" width="1920" height="600"> we want to access images from BigCommerce WebDev File Manager.


Solution

  • There are 2 ways to load images from WebDAV on your storefront.

    You can use the absolute path to the images: <img src="https://cdn11.bigcommerce.com/s-xw5rimf0vt/content/carousel/1920x600-3.jpg" width="1920" height="600">

    Or, you can use the WebDAV CDN path: <img src="{{cdn 'webdav:carousel/1920x600-3.jpg'}}" width="1920" height="600">