Product
The product
object has the following attributes:
product.features
Returns an array of features. Each feature has name
and value
.
Input
<ul>
{% for feature in product.features %}
<li>
<span>{{ feature.name }}</span>
<span>{{ feature.value }}</span>
</li>
{% endfor %}
</ul>
Output
<ul>
<li>
<span>Produced in</span>
<span>Cambodia</span>
</li>
</ul>
product.photos
Returns an array of the product’s photos. Use the attachment_url filter to link to the image on Yoolk’s Content Delivery Network. [Optional]
Input
{% for photo in product.photos %}
{{ photo | attachment_url: 'medium' | image_tag }}
{% endfor %}
Output
<img src="http://s-yoolk-images1.yoolk.com/kh/product_images/medium/1367097277/1250047?1367097277" />
Parameters: image sizes
styles | size |
---|---|
thumbnail | 49 x auto |
small | 186 x auto |
medium | 350 x auto |
large | 994 x auto |
product.cover_photo
Returns the first photo of a product.
Input
{{ product.cover_photo | attachment_url: 'medium' | image_tag }}
Output
<img src="http://s-yoolk-images0.yoolk.com/kh/product_catalog/product_images/medium/1406022689/1145?1406022689" />
product.url
Returns the url of a product.
Input
<a href="{{ product.url }}">{{ product.name }}</a>
Output
<a href="/products/9200-pc-laptops-netbooks/3852-lenovo-z580">Lenovo Z580</a>