A
A
Alex2017-05-28 18:58:43
1C-Bitrix
Alex, 2017-05-28 18:58:43

What is wrong with this condition?

Good afternoon, I display the property of the page, it is necessary that if it is empty, it does not display anything.
But under this condition, it only displays the value . What is the error. Thank you<?$APPLICATION->ShowProperty("img")?>

<?if($APPLICATION->ShowProperty("img") > 0):?>
   <img class="img-responsive" src="<?=SITE_TEMPLATE_PATH?>/images/<?$APPLICATION->ShowProperty("img")?>.jpg"/> 
 <?else:?>
 <?endif;?>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Gritsuk, 2017-05-28
@winer

Use GetProperty

M
Maxim Pavlov, 2017-05-28
@Ifelseapps

Write to the property along with the html markup and output via ShowProperty (but remember that this is a deferred function and it does not return the value of the property. It just displays it on the screen).

O
Oleg Mifle, 2017-05-29
@OlegMifle

There is a GetPageProperty

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question