ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Styling Links based on Current Category

June 16, 2013 12:53pm

Subscribe [2]
  • #1 / Jun 16, 2013 12:53pm

    olivertomberry

    7 posts

    Hi guys

    I’m working on this site at the moment:
    http://oliverberry.com/ee/index.php/writing/category/travel

    I have a pretty simple request which I’m sure should be easy to figure out, but I can’t see a way to do it!

    Basically I just want to style the top category links so that the current category is styled differently to the others (this is essentially another way of showing the ‘active’ category).

    Any ideas on how to do it? I thought about maybe using an ‘If’ statement with Segments, but again not quite sure how to do this.

    Many thanks for your help!

    Oliver

  • #2 / Jun 16, 2013 10:50pm

    Bhashkar Yadav

    727 posts

    Hi Oliver,

    You can check the category_url_title with segment_3 like:

    {if category_url_title == segment_3}class="current_category"{/if}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases