Answer the question
In order to leave comments, you need to log in
How to check if an image exists in Joomla 3.x?
Hello.
My news output is as follows
<div class="col-sm-6 minor">
<a class="title-news-minor" href="<?=$item->link?>">
<img src="<?=$images->image_intro?>" alt="<?=$item->title?>" title="<?=$item->title?>" class="no-lightbox">
<<?=$item_heading?>><?=$item->title?></<?=$item_heading?>>
</a>
<p class="date-news"><?php echo $item->created;?></p>
</div>
Answer the question
In order to leave comments, you need to log in
Thanks for the tip. I did it with pictures
<div class="col-sm-6 minor">
<a class="title-news-minor" href="<?=$item->link?>">
<?php if(isset($images->image_intro) && $images->image_intro !== '') {
?>
<img src="<? echo $images->image_intro; ?>" alt="<? echo $item->title; ?>" title="<?echo $item->title; ?>" class="no-lightbox">
<?
} ?>
<<?=$item_heading?>><?=$item->title?></<?=$item_heading?>>
</a>
<p class="date-news"><?php echo $item->created;?></p>
</div>
The questions are too simple.
And most importantly, everything is googled in 5 minutes.
I know, because I myself once looked for exactly the same questions.
Correct check for emptyness of a variable?
if(isset($var) && $var !== '') {
// $var не null и не ''.
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question