These are chat archives for locomotivecms/v3

14th
Dec 2016
Jordan Thomas
@jordanthomas
Dec 14 2016 00:33
@did I have a subnavigation I'm trying to add "active" css classes to. The menu is built by looping through one of my content_types, and the pages are templatized by a content_type_template file. However the <content_type>._slug is the singularized version of the current page.slug. Is there a better property to determine what my current page is? Or should I just singularize page.slug?
Jordan Thomas
@jordanthomas
Dec 14 2016 00:40
Sorry I got that backwards. page.slug is the singular, <content_type>._slug is plural
Jordan Thomas
@jordanthomas
Dec 14 2016 01:10
Here's what I landed on:
{% for content in contents.content_type %}
  {% capture content_path %}{% path_to content %}{% endcapture %}
  <li{% if path == content_path %} class="active"{% endif %}>
{% endfor %}