1

I am trying to show an active class if an entry is being viewed but my conditional's are not working:

{if last_segment == '{url_title'}  class="active"  {/if}

I am using an embed of a list of entries on a product detail page. I want the active entry to have a class of active

This is not working even though last_segment and url_title are the same

this is my embeded template:

{exp:channel:entries channel="products" category="{segment_3_category_id}"}

    <li {if last_segment == '{url_title}'} class="active"{/if}><a href="{title_permalink='Products/detail/{segment_3}/{segment_4}'}">{title} &raquo;</a></li>

    {/exp:channel:entries}
2

solved: {if url_title == "{last_segment}"} class="active"{/if}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.