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.

highlight the selected entry to show that’s section the user is on

April 16, 2012 12:57pm

Subscribe [2]
  • #1 / Apr 16, 2012 12:57pm

    nomoretables

    42 posts

    I’m using entry titles as links to different section of a photo gallery. How can I highlight the selected entry to show that’s section the user is on.

  • #2 / Apr 16, 2012 2:16pm

    artminister

    159 posts

    You can compare the segment ID to the entry url title to highlight certain sections. Eg:

    {if segment_2 == url_title}class="active"{/if}
  • #3 / Apr 16, 2012 4:29pm

    nomoretables

    42 posts

    brilliant, that worked a charm, thanks! although it only works once a link is clicked. As default I’m displaying all the image thumbnails from the first entry, how can I dynamically have the first entry always selected so that it get’s the class of active?

  • #4 / Apr 17, 2012 11:45am

    Shane Eckert

    7174 posts

    Hello nomoretables,

    I am going to move this thread over to the Community Help Forum where you are sure to get some practical advice.

    One thing to experiment with is using an embedded variable.

    {if embed:which_photo=='first'} class="active"{/if}

    It might also help to see your template code so we can better understand what you are doing.

    Cheers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases