Skip to main content
added 1308 characters in body
Source Link

UPDATE 2:

Currently using this code now. Incorporated elseif, single quote wraps tag when tag has double quote, etc.

{if "{member_images:total_rows}" == 0}
    {!-- No images uploaded. Display placeholder as avatar. --}
    <img class="img-polaroid" src="http://placehold.it/133x100/&text=No Image" alt="No Image"/>
{if:elseif "{member_images:total_rows}" == 1}
    {!-- Only one image uploaded. Display that image as avatar. --}
    {member_images}
        <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
    {/member_images}
{if:elseif "{member_images:total_rows}" > 1}
    {if '{member_images:total_rows search:default="y"}' == 0}
        {!-- Multiple images uploaded, but none defined as default. Display first image as avatar. --}
        {member_images limit="1"}
            <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
        {/member_images}                                                    
    {if:elseif '{member_images:total_rows search:default="y"}' == 1}
        {!-- Multiple images uploaded, and one defined as default. Display that image as avatar. --}                                
        {member_images search:default="y"}
            <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
        {/member_images}                            
    {/if}
{/if}

UPDATE 2:

Currently using this code now. Incorporated elseif, single quote wraps tag when tag has double quote, etc.

{if "{member_images:total_rows}" == 0}
    {!-- No images uploaded. Display placeholder as avatar. --}
    <img class="img-polaroid" src="http://placehold.it/133x100/&text=No Image" alt="No Image"/>
{if:elseif "{member_images:total_rows}" == 1}
    {!-- Only one image uploaded. Display that image as avatar. --}
    {member_images}
        <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
    {/member_images}
{if:elseif "{member_images:total_rows}" > 1}
    {if '{member_images:total_rows search:default="y"}' == 0}
        {!-- Multiple images uploaded, but none defined as default. Display first image as avatar. --}
        {member_images limit="1"}
            <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
        {/member_images}                                                    
    {if:elseif '{member_images:total_rows search:default="y"}' == 1}
        {!-- Multiple images uploaded, and one defined as default. Display that image as avatar. --}                                
        {member_images search:default="y"}
            <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
        {/member_images}                            
    {/if}
{/if}
Tweeted twitter.com/#!/StackExpression/status/287910526879682560
added 16 characters in body
Source Link
{stash:embed name="common:.avatar" process="start"}
{stash:embed name="common:.avatar"}
{stash:embed name="common:.avatar" process="start"}
added 293 characters in body
Source Link

UPDATE 1:

The culprit seems to be the nested if block, particularly the if-conditions (e.g. {if "{member_images:total_rows search:default="y"}" == 0}. The if-condition contains a tag that must first be parsed? I'm guessing this might have something to do with parsing order, etc.?

UPDATE 1:

The culprit seems to be the nested if block, particularly the if-conditions (e.g. {if "{member_images:total_rows search:default="y"}" == 0}. The if-condition contains a tag that must first be parsed? I'm guessing this might have something to do with parsing order, etc.?

Source Link
Loading