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.

menu question - show hide current

February 22, 2012 10:06pm

Subscribe [2]
  • #1 / Feb 22, 2012 10:06pm

    jules6120

    15 posts

    I have a news menu which shows the 6 most recent news items…

    I have successfully set it up so the current news item is not “linked” (see code below)

    My Question: Instead I’d like to hide/remove this “current link” all together, so that if I’m on that page the link does not populate the list - but i still end up with a list of 6 news items (with the next most recent news item “joining the list”)...


    I’m sure this is simple!

    ——————————————-

    {exp:channel:entries channel="news" orderby="date" sort="desc" limit="6" dynamic="no" status="Open|Featured"}

    <ul id=“subList”>
    <li class=”{switch='first|second|third|fourth|fifth|last'}”>{if url_title != segment_2}{title}
    {if:else}{title}{/if}
    </li>

    {/exp:channel:entries}

    ——————————————-

    CHEERS

  • #2 / Feb 23, 2012 6:20am

    Mark Bowen

    12637 posts

    Hiya,

    Just add in the url_title=”“ parameter to your Channel Entries tag in this way :

    {exp:channel:entries
     url_title="not {segment_3}"
     channel="news"
     orderby="date"
     sort="desc"
     limit="6"
     dynamic="no"
     status="Open|Featured"
     disable="member_data|trackbacks|categories|category_fields|pagination"}
    
    {title}
    
    {/exp:channel:entries}

    You may need to change the {segment_3} in the code above if you’re not using standard ExpressionEngine routing.

    Hope that helps a bit.

    Best wishes,

    Mark

     

  • #3 / Feb 23, 2012 5:51pm

    jules6120

    15 posts

    That’s perfect and worked like a charm - I really appreciate your help.

    CHEERS

    Jules

  • #4 / Feb 23, 2012 10:43pm

    Kevin Smith

    4784 posts

    Thanks for the help on this one, Mark!

    Jules, if there’s anything else we can help you with, please let us know.

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

ExpressionEngine News!

#eecms, #events, #releases