Service Category
The service_category
object has the following attributes:
service_category.services
Returns an array of the service_category’s services. [Optional]
service_category.url
Returns the url of a service_category.
Input
<a href="{{ service_category.url }}">{{ service_category.name }}</a>
Output
<a href="/services/kh12806-office-rental-services">Office Rental Services</a>
service_category.current?
Returns true if this service_category is the one which is currently displayed.
Input
<ul class="nav">
{% for service_category in listing.service_categories %}
<li>
<a href="{{ service_category.url }}" {% if service_category.current? %}class="active"{% endif %}>{{ service_category.name }}</a>
</li>
{% endfor %}
</ul>
Output
<ul class="nav">
<li><a href="/products/1-shirt" class="active">Shirt</a></li>
<li><a href="/products/2-shoe">Shoe</a></li>
</ul>