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.

How can I do a simple check???

January 19, 2010 6:47pm

Subscribe [2]
  • #1 / Jan 19, 2010 6:47pm

    vanquish

    48 posts

    So I finally managed to get going with the templates and displaying results coming from my module.
    The new brick wall is checking if the returned data was empty or not.

    I’m unable to detect if the returned data was empty or not, here is what I have:


    {exp:cities:list}
            
            {city_info}
                // the title is there and showing on the page 
                            <h1>{title}</h1>
                            // this if statement does nothing 
                {if title !=''}
                    the title was echoed
                {/if}
            
            {/city_info}
            
        {/exp:cities:list}

    I also tried this:

    {exp:cities:list}
            // if I put this if statement here, even when there is a city_info it does not show it anymore 
                    {if city_info !=''}
            {city_info}
                // the title is there and showing on the page
                            <h1>{title}</h1>
                            // this if statement does nothing 
                {if title !=''}
                    the title was echoed
                {/if}
            
            {/city_info}
                    {/if}
    
                    {if city_info==''}
                    <h1>Sorry, no info about this city</h1>
            {/if}
    {/exp:cities:list}

    The question is:

    How can I do a SIMPLE checking if (array, single variable, returned data) exist or not??
    This is so frustrating ! It is as if I’m learning to crawl all over again after being the world champion in running !!

  • #2 / Jan 20, 2010 1:06pm

    vanquish

    48 posts

    Update: It turns out Expression Engine is buggy as hell!

    This guy’s problem is related:
    http://ellislab.com/forums/viewthread/142198/

  • #3 / Jan 20, 2010 3:23pm

    Ingmar

    29245 posts

    Update: It turns out Expression Engine is buggy as hell!

    If you are talking about EE 2.0 PB: it is a Beta after all.

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

ExpressionEngine News!

#eecms, #events, #releases