All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Selected month in Archive navigation

Lu 26 Oct 2012 17:12 question, complete

Hi,
Just a quick question.
I'm using Low Yearly archives and I'm doing this archive navigation:

{exp:low_yearly_archives channel="blog" status="not closed" sort="desc" monthsort="desc" start_month="1"}
<ul>
{months}
{if num_entries != 0}
<li>
<a href="{path=blog/archive}/{year}/{month_num}/"
title="{num_entries} entries in {month} {year}">{month} {year} ({num_entries})</a>
</li>
{/if}
{/months}
</ul>
{/exp:low_yearly_archives}


And I wanted to know if there's a way to have a selected class for the nav item I'm on.

Thanks!
Lu

Replies

  1. Low 28 Oct 2012 07:36

    Use something like this:

    {if "{segment_3}-{segment_4}" == "{year}-{month_num}"} 
    class="active"
    {/if}

  2. Lu 29 Oct 2012 10:19

    Awesome! :D Thanks!