Extracting all images from an article for a slideshow gallery
by Kiet Huynh · November 26, 2018
Sell Online With Shopify
Trusted by millions of businesses worldwide
Sign up for a free trial and enjoy 3 months of Shopify for $1/month on select plans.
The below liquid code help you extract all images from an article.
| {% assign article_content = article.content | escape %} {% if article_content contains '<img' %} {% assign article_content = article_content | split: '<img src="' %} {% for all_img in article_content %} {% if forloop.index != 1 %} {% assign a_img = all_img | escape %} {% assign a_img = a_img | split: '&' %} <img src="{{ a_img[0] }}"> {% endif %} {% endfor %} {% else %} {% endif %} |
You can use it to create a slideshow gallery.
Related
Related Posts via Categories
Looking for Shopify Experts?
Hura Apps can help you take your store to the next level
Our team of experienced designers and developers can help you create a beautiful, high-converting Shopify store that will drive sales and increase customer satisfaction. From custom design to app development and optimization, we have the skills and expertise to help you achieve your eCommerce goals.
Get in touchTags: articlearticle shopitygalleryliquidliquid codeShopify liquidslideshowslideshow gallery
You may also like...