Page 1 of 1

Edit Page > options > Image Drop Down

Posted: Thu Mar 25, 2010 9:21 pm
by fivepix
Hi all,

I’m using GetPropertyValue('image')}"/> in my template to display an image selected from the “Image” drop down in the edit page screen, this feature works great when you select an image to display, but I have found that in explorer when an image is not selected I get a red X or missing image icon.

Is there a way to hide if no image value is found?

Using: CMS Made Simple 1.6.7 "Teremba Bay"

Re: Edit Page > options > Image Drop Down

Posted: Fri Mar 26, 2010 7:56 am
by owr_bgld

Code: Select all

{if isset($content_obj->GetPropertyValue('image')) and $content_obj->GetPropertyValue('image') != ''}
here comes your img-tag
{/if}
this should work

Re: Edit Page > options > Image Drop Down

Posted: Fri Mar 26, 2010 1:51 pm
by fivepix
Hi owr_bgld,

I get the following error when I placed you code in my template
Fatal error: Can't use method return value in write context in /***/***/public_html/beta/tmp/templates_c/%%E1^E1E^E1E3E438%%tpl_body%3A29.php on line 39

Re: Edit Page > options > Image Drop Down

Posted: Sat Mar 27, 2010 8:34 pm
by owr_bgld
you can try to change from != '' to != "" (the doubles instead of the single ones) or try only

Code: Select all

{if isset($content_obj->GetPropertyValue('image'))}