Yoolk Liquid

Home Objects F_category

Food Category

The food_category object has the following attributes:

food_category.foods

Returns an array of the food_category’s foods. [Optional]

food_category.foods_url

Returns the url of a food_category.

Input

<a href="{{ food_category.foods_url }}">{{ food_category.name }}</a>

Output

<a href="/menu/9200-soft-drinks">Soft Drinks</a>

food_category.current?

Returns true if this food_category is the one which is currently displayed.

Input

<ul class="nav">
  {% for food_category in listing.food_categories %}
    <li>
      <a href="{{ food_category.foods_url }}" {% if food_category.current? %}class="active"{% endif %}>{{ food_category.name }}</a>
    </li>
  {% endfor %}
</ul>

Output

<ul class="nav">
  <li><a href="/menu/1-drinks" class="active">Drinks</a></li>
  <li><a href="/menu/2-sea-foods">Sea Foods</a></li>
</ul>