[solved] Put {sectionimage} in a conditional statement to check if image exists
Posted: Wed Feb 10, 2010 4:57 am
If you include {sectionimage} on a page and image does not exist CMSMS will create a blank box where the picture should go.
I would like to put the Tag {sectionimage} in a conditional statement to see if the image does indeed exist. If it does I would like to show the image. If it does not I don't want to show the blank box. I have tried the following but it does not seem to work:
{if $sectionimage ne ''}
{sectionimage lowercase=1 levels=2 byname=1 image_path=uploads/images/page}
{/if}
The image will produce fine if I don't have the {if $sectionimage ne ''} there, but as it is written it will not work.
Can anybody offer any suggestions? Would there be another way to check and see if a filename exists based on the Alias of the present page?
I would like to put the Tag {sectionimage} in a conditional statement to see if the image does indeed exist. If it does I would like to show the image. If it does not I don't want to show the blank box. I have tried the following but it does not seem to work:
{if $sectionimage ne ''}
{sectionimage lowercase=1 levels=2 byname=1 image_path=uploads/images/page}
{/if}
The image will produce fine if I don't have the {if $sectionimage ne ''} there, but as it is written it will not work.
Can anybody offer any suggestions? Would there be another way to check and see if a filename exists based on the Alias of the present page?