Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

Hey Jones! commented on How to change the image in by banner daily wise?

$
0
0

You could probably do something along these lines, provided that you've uploaded the appropriately named files to your /assets folder:

{% capture w %}{{ 'now' | date: '%w' }}{% endcapture %}
<img src="{{ 'banner-w.jpg' | replace: 'w', w | asset_url }}">

Which would return:

<img src="//cdn.shopify.com/s/files/1/0699/1389/t/1/assets/banner0.jpg?9"> on Sunday, "banner1.jpg" on Monday, etc.

That will return the current date / time on the server, so it's possible that the end user might see it sooner or later than they should. If you need it to be accurate on the user end you'd need to implement a JavaScript solution.


Viewing all articles
Browse latest Browse all 25503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>