Skip to main content
Unnecessary
Source Link
Sharky
  • 12k
  • 8
  • 23

If you mean the intro image that's used in intro_image layout, use the same check as in the layout:

<?php $images = json_decode($this->item->images); ?>
<?php if (isset($images->image_intro) && !empty($images->image_intro)) : ?>
    <div><?php echo $this->item->introtext; ?></div>
<?php else : ?>
    <?php echo $this->item->introtext; ?>
<?php endif; ?>

If you mean the intro image that's used in intro_image layout, use the same check as in the layout:

<?php $images = json_decode($this->item->images); ?>
<?php if (isset($images->image_intro) && !empty($images->image_intro)) : ?>
    <div><?php echo $this->item->introtext; ?></div>
<?php else : ?>
    <?php echo $this->item->introtext; ?>
<?php endif; ?>

If you mean the intro image that's used in intro_image layout, use the same check as in the layout:

<?php $images = json_decode($this->item->images); ?>
<?php if (!empty($images->image_intro)) : ?>
    <div><?php echo $this->item->introtext; ?></div>
<?php else : ?>
    <?php echo $this->item->introtext; ?>
<?php endif; ?>
Source Link
Sharky
  • 12k
  • 8
  • 23

If you mean the intro image that's used in intro_image layout, use the same check as in the layout:

<?php $images = json_decode($this->item->images); ?>
<?php if (isset($images->image_intro) && !empty($images->image_intro)) : ?>
    <div><?php echo $this->item->introtext; ?></div>
<?php else : ?>
    <?php echo $this->item->introtext; ?>
<?php endif; ?>