Home Theme-templates Menu-index
menu/index.liquid
The menu/index.liquid
template is used to render the foods
of current listing.
Template Considerations
Filtering by categories
You can use food categories to filter a collection into smaller subsets of foods. For example, if you are in a collection and want to only show foods with the category “ice-cream”, you can do so by appending the category’s handle to the end of the foods’s URL.
http://my-shop.yoolk.com/menu/<food-id>-ice-cream
For more details and examples, see (tutorial).
Paginating
Yoolk limits the number of foods that can be output per page to 12. For this reason, collections with more than 12 foods, must use the paginate tag to split the collection into multiple pages.
{% paginate listing.foods by 25 %}
{% for food in paginate.collection %}
<!--show food details here -->
{% endfor %}
{% endpaginate %}
Requirements for the Theme
If you’re looking to submit your theme to the Yoolk Theme, the menu/index.liquid template of your theme must meet the following conditions:
-
foods are listed in a grid or list, with the following attributes of the food variable output:
food.name
(not break the layout when name is long and links to food.url)food.price
food.cover_photo
- Must have a link to download catalog if current listing have menu pdf
- food grid must not break even with food images of varying aspect ratios
- Links for filtering a collection by food categories (tutorial)
- Use proper pagination