Food
The food
object has the following attributes:
food.properties
Returns an array of properties. Each property has name
and value
.
Input
<ul>
{% for property in food.properties %}
<li>
<span>{{ property.name }}</span>
<span>{{ property.value }}</span>
</li>
{% endfor %}
</ul>
Output
<ul>
<li>
<span>Type</span>
<span>Ice Cream</span>
</li>
</ul>
food.photos
Returns an array of the food’s photos. Use the attachment_url filter to link to the image on Yoolk’s Content Delivery Network. [Optional]
Input
{% for photo in food.photos %}
{{ photo | attachment_url: 'medium' | image_tag }}
{% endfor %}
Output
<img src="http://s-yoolk-images1.yoolk.com/kh/food_images/medium/1367097277/1250047?1367097277" />
Parameters: image sizes
styles | size |
---|---|
thumbnail | 50 x 50 |
small | 196 x auto |
medium | 364 x auto |
large | 994 x auto |
food.cover_photo
Returns the first photo of a food.
Input
{{ food.cover_photo | attachment_url: 'medium' | image_tag }}
Output
<img src="http://s-yoolk-images0.yoolk.com/kh/menu/foods/medium/1406022689/1145?1406022689" />
food.url
Returns the url of a food.
Input
<a href="{{ food.url }}">{{ food.name }}</a>
Output
<a href="/menu/9200-soft-drinks/3852-coke">Coke</a>