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.

Entry url Conditional

May 28, 2012 4:09pm

Subscribe [3]
  • #1 / May 28, 2012 4:09pm

    Kaspar

    30 posts

    Hi

    I have a blog entry. At the bottem of the entry is a channel entry tag with a summary of all the Blog entrys avalable.

    In this summary there is always one entry which is the current one. I’d like to style this entry diffrent than the other ones.
    I’m triyng to write such a conditional. But a cant get it to work.

    This is the code of the overview:

    <!--Blog entry Overview -->
    {exp:channel:entries channel="blog" dynamic="no"}
      <div class="three columns {if entry == '[MODERATOR EDIT]removed Censored Word [END MODERATOR EDIT] same as the entry itself'}current_entry{/if}">
       <h6>
        <a href="http://{title_permalink=blog/view}">{title}</a>
       </h6>
    <p>   {projektart}<br />
      </div><br />
    {/exp:channel:entries}

    I tried to compare the entry Url with the url Segment. But I couldn’t get it to work.

    {if enrty_url == "segment_3"}add-this{/if}

    Thanks for any help.

     

  • #2 / May 30, 2012 12:59am

    Manoj Thomas

    185 posts

    {if url_title == segment_3} do this {/if}
  • #3 / May 30, 2012 10:13am

    Shane Eckert

    7174 posts

    Hey Kaspar,

    Manoj is right, url_title is the way to go!

    Please let us know if there is anything else we can do for you?

    Cheers,

  • #4 / May 31, 2012 6:21am

    Kaspar

    30 posts

    Thanks a lot for your help. I struggle with these conditionals all the time.

    Regards.

  • #5 / Jun 01, 2012 3:19pm

    Shane Eckert

    7174 posts

    Hey Kaspar,

    No worries! You are not alone in that struggle.

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases