Code: Select all
<h1 class="h-4"><?php echo $this->escape($article->title); ?></h1>
Moderator: General Support Moderators
Post by SocketPup » Mon Apr 08, 2024 5:09 pm
Code: Select all
<h1 class="h-4"><?php echo $this->escape($article->title); ?></h1>
Post by pe7er » Mon Apr 08, 2024 8:03 pm
Code: Select all
<?php
$images = json_decode($article->images);
echo '<img src="' . $this->escape($images->image_intro) . '" alt="Intro Image">';
echo '<img src="' . $this->escape($images->image_fulltext) . '" alt="Full Image">';
?>
Post by SocketPup » Tue Apr 09, 2024 7:16 am
Thanks, that's exactly what I was looking for!pe7er wrote: ↑Mon Apr 08, 2024 8:03 pm The article contains an images field where both the intro and full image can stored in JSON format.
To display them you could use something like:Code: Select all
<?php $images = json_decode($article->images); echo '<img src="' . $this->escape($images->image_intro) . '" alt="Intro Image">'; echo '<img src="' . $this->escape($images->image_fulltext) . '" alt="Full Image">'; ?>
Post by pe7er » Tue Apr 09, 2024 9:25 am
Return to “General Questions/New to Joomla! 5.x”
© 2005 - 2024 Open Source Matters, Inc. All Rights Reserved.