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.

If conditional within an if conditional..

July 25, 2011 3:15pm

Subscribe [7]
  • #31 / Aug 09, 2011 8:54pm

    Boyink!

    5011 posts

    I just spent most of a day bumping into this issue.

    Here’s the code that works:

    {categories limit="1"}
        {if category_id == "12"}
            {resource_center_thumb}
        {/if}
        {if category_id != "12"}
            {if "{resource_center_thumb}" !=""}    
                {resource_center_thumb}
            {/if}
            
            {if "{resource_center_thumb}" == ""}
                {site_url}images/site_design/bg/{category_image}    
            {/if}    
        {/if}
    {/categories}

    It only started working once the field names in the lowest-level conditionals were put in that form. If I tried:

    {if resource_center_thumb !=""}    
        {resource_center_thumb}
            {/if}
            
            {if resource_center_thumb == ""}
                {site_url}images/site_design/bg/{category_image}    
            {/if}

    As I normally code the outer loop didn’t work correctly and all entries returned got handled in the second clause.

  • #32 / Aug 11, 2011 4:37pm

    Dan Decker

    7338 posts

    Etheya,

    Are you still experiencing any issues? Rasmus and Mike, thanks for your input along the way.

    Please let us know if you need further assistance, and if not, would you mind sharing the solution that worked for you?

    Thanks,

  • #33 / Aug 18, 2011 2:48pm

    bmschaaf

    171 posts

    This seems very related to this: https://support.ellislab.com/bugs/detail/16399/

    I hope EE figures this out very soon.

  • #34 / Aug 18, 2011 5:47pm

    Kevin Smith

    4784 posts

    We’ve definitely got it on our radar, Ben. Until a fix comes through on the bug report, does using Etheya’s fix here provide a necessary workaround?

  • #35 / Aug 18, 2011 5:55pm

    bmschaaf

    171 posts

    We’ve definitely got it on our radar, Ben. Until a fix comes through on the bug report, does using Etheya’s fix here provide a necessary workaround?

    Sadly, no.

    Update: Actually, Boyink!‘s (Sidenote: Woo Holland!) suggestion works in my case. B/c I had a conditional, in a conditional, in a categories tag.

    Update 2: This only fixed my less complex conditional. This is still very much an issue.

  • #36 / Aug 19, 2011 5:03pm

    Kevin Smith

    4784 posts

    Ok, hang tight guys. I’m chasing this up to the devs to see if we can get someone to look at it and try to offer a fix soon. I understand this is very much an issue for everyone, and I don’t want you to think we’re just sitting back waiting for one of you to fix it.

    I’ll report back when I know more!

  • #37 / Nov 11, 2011 12:30pm

    Etheya

    213 posts

    Back to same issue with this for me… its all working using the extra “{}" in the actual fields… but the only place im struggling with it is when using with MATRIX.. its just not liking it..

    this works fine..

    {categories} 
    {if category_id == "111"}    
      
     {if "{arrivals-tag}"}{arrivals-tag}{/if}      
     {if "{arrivals-location}"}<h3>Location: {arrivals-location}</h3><p>{/if}  <br />
    {/if}<br />
    {/categories}

    but it just doesnt like the following the matrix part breaks things.. any ideas anyone?

    {categories} 
    {if category_id == "111"}    
      
     {if "{arrivals-tag}"}{arrivals-tag}{/if}      
     {if "{arrivals-location}"}<h3>Location: {arrivals-location}</h3><p>{/if}<br />
     {if "{arrivals-img}"}      <br />
     {arrivals-img}<br />
      {exp:ed_imageresizer image="{arrivals-image}" default="" class="fr" maxWidth="350"  alt="{arrivals-cap}" }        <br />
     {/arrivals-img}<br />
     {/if}<br />
    {/if}<br />
    {/categories}

  • #38 / Nov 16, 2011 11:14am

    Kevin Smith

    4784 posts

    Hi Etheya,

    Sorry to see this has crept back up for you. This being third-party specific, I’m not positive it’s something we have the ability to fix, but I want to check into it all the same. I’m pinging Robin to see if she can take a deeper look and suss out the problem. Thanks for your patience while we look into it!

  • #39 / Nov 21, 2011 4:03pm

    Dan Decker

    7338 posts

    Hi Etheya,

    What is happening with the Matrix part of this? is the conditional not being evaluated at all? If you take it a little further and try:

    {if "{arrivals-img}" !=""}      
     {arrivals-img}
      {exp:ed_imageresizer image="{arrivals-image}" default="" class="fr" maxWidth="350"  alt="{arrivals-cap}" }        
     {/arrivals-img}
     {/if}

    What are the results?

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

ExpressionEngine News!

#eecms, #events, #releases