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.

Problems with 1.64 if statement

July 23, 2010 6:06am

Subscribe [3]
  • #1 / Jul 23, 2010 6:06am

    Murmann

    36 posts

    This works:

    {if segment_2 == "news"}
    <div class="showrss">
    {rss_icon} <a href="http://{path=rss/index}">RSS</a>
    </div>
    {/if}

    But this does not work?

    {if blogname == "news"}
    <div class="showrss">
    {rss_icon} <a href="http://{path=rss/index}">RSS</a>
    </div>
    {/if}

    Can anyone tell me why. I need the second one so it shows up on
    etss.net/index.php

  • #2 / Jul 23, 2010 10:02am

    Ingmar

    29245 posts

    “Blogname” is not available in this context. Perhaps you mean {weblog_name}, unless it’s a custom variable?

  • #3 / Jul 24, 2010 5:42am

    Murmann

    36 posts

    I think it is a custom variable. Because the same code is on another site of mine that runs an earlier version of EE. It worked on etss.net before. I think I stopped working after we upgraded to 1.64.

  • #4 / Jul 24, 2010 3:03pm

    Greg Salt

    3988 posts

    Hi Murmann,

    Firstly, I recommend that you upgrade to the latest version of EE 1.x if possible. The latest is 1.6.9.

    Is this piece of code between exp:weblog tags?

    Can you also please check the weblog that this code is pulling data from and see whether there is a custom field called ‘blogname’? The custom fields are at Admin > Weblog Administration > Field Groups in your CP and you can see which weblogs have which field groups assigned by going to Admin > Weblog Administration > Weblog Management.

    Cheers

    Greg

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

ExpressionEngine News!

#eecms, #events, #releases