You could do this by creating a HTML override as follows:We want
1. the article title
2. the article
3. the read more button
4. the article information
So exactly as it has been since Joomla 2 to Joomla 4
(a) Copy the file blog_item.php that is under the directory \components\com_content\tmpl\category to the directory \templates\your-cassiopeia-child-name\html\com_content\category
(b) Edit the file blog_item.php that is under the directory \templates\your-cassiopeia-child-name\html\com_content\category
(c) Rearrange the following lines of code as shown below:
Original code:
Code:
...... <?php echo $this->item->introtext; ?> <?php if ($info == 1 || $info == 2) : ?> <?php if ($useDefList) : ?> <?php echo LayoutHelper::render('joomla.content.info_block', ['item' => $this->item, 'params' => $params, 'position' => 'below']); ?> <?php endif; ?> <?php if ($params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?> <?php echo LayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?> <?php endif; ?> <?php endif; ?> <?php if ($params->get('show_readmore') && $this->item->readmore) : if ($params->get('access-view')) : $link = Route::_(RouteHelper::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); else : $menu = Factory::getApplication()->getMenu(); $active = $menu->getActive(); $itemId = $active->id; $link = new Uri(Route::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); $link->setVar('return', base64_encode(RouteHelper::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language))); endif; ?> <?php echo LayoutHelper::render('joomla.content.readmore', ['item' => $this->item, 'params' => $params, 'link' => $link]); ?> <?php endif; ?> <?php if ($isUnpublished) : ?> </div> <?php endif; ?>......
Code:
...... <?php echo $this->item->introtext; ?> <?php if ($params->get('show_readmore') && $this->item->readmore) : if ($params->get('access-view')) : $link = Route::_(RouteHelper::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); else : $menu = Factory::getApplication()->getMenu(); $active = $menu->getActive(); $itemId = $active->id; $link = new Uri(Route::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); $link->setVar('return', base64_encode(RouteHelper::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language))); endif; ?> <?php echo LayoutHelper::render('joomla.content.readmore', ['item' => $this->item, 'params' => $params, 'link' => $link]); ?> <?php endif; ?> <?php if ($info == 1 || $info == 2) : ?> <?php if ($useDefList) : ?> <?php echo LayoutHelper::render('joomla.content.info_block', ['item' => $this->item, 'params' => $params, 'position' => 'below']); ?> <?php endif; ?> <?php if ($params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?> <?php echo LayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?> <?php endif; ?> <?php endif; ?> <?php if ($isUnpublished) : ?> </div> <?php endif; ?>......
Before change: After change:
Statistics: Posted by imanickam — Sun Nov 17, 2024 4:24 pm