From e5a803d74f1ef6801d75c9cb025df8986674d5fd Mon Sep 17 00:00:00 2001 From: Sonny Le Date: Thu, 1 Aug 2024 11:24:33 +0700 Subject: [PATCH] Improve Related article style --- framework/frontend/blog/modules/related.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/framework/frontend/blog/modules/related.php b/framework/frontend/blog/modules/related.php index b1fdfa10..3b4c71d5 100644 --- a/framework/frontend/blog/modules/related.php +++ b/framework/frontend/blog/modules/related.php @@ -11,6 +11,7 @@ */ use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; +use Joomla\Registry\Registry; // No direct access. defined('_JEXEC') or die; @@ -25,16 +26,25 @@
images); $astroidArticle = new Astroid\Article($item, true); + // Post Format + $post_attribs = new Registry(json_decode($item->attribs)); + $post_format = $post_attribs->get('post_format', 'standard'); + $image = $astroidArticle->getImage(); ?>
image_intro)) { + echo ''; + } else if (is_string($image) && !empty($image)) { + echo '
'; + $document->include('blog.modules.image', ['image' => $image, 'title' => $item->title, 'item' => $item]); + echo '
'; + } else { + echo LayoutHelper::render('joomla.content.post_formats.post_' . $post_format, array('params' => $post_attribs, 'item' => $item)); + } ?> - - - -