Skip to content

Commit

Permalink
Update read more to use jlayout
Browse files Browse the repository at this point in the history
  • Loading branch information
RickR2H committed Sep 27, 2024
1 parent e00e280 commit a81d79c
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions modules/mod_articles/tmpl/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<article class="mod-articles-item" itemscope itemtype="https://schema.org/Article">

<?php if ($params->get('item_title') || $displayInfo || $params->get('show_tags') || $params->get('show_introtext') || $params->get('show_readmore')) : ?>
<div class="mod-articles-item-content<?php echo $item->active ? ' $item->active' : ''; ?>">
<div class="mod-articles-item-content<?php echo $item->active ? ' active' : ''; ?>">

<?php if ($params->get('item_title')) : ?>
<?php $item_heading = $params->get('item_heading', 'h4'); ?>
Expand Down Expand Up @@ -106,22 +106,12 @@
<?php echo $item->displayIntrotext; ?>
<?php endif; ?>

<?php if ($params->get('show_readmore')) : ?>
<p class="mod-articles-item-readmore">
<a class="mod-articles-item-title btn btn-secondary" href="<?php echo $item->link; ?>">
<?php echo '<span class="icon-chevron-' . $direction . '" aria-hidden="true"></span>'; ?>
<?php if ($item->alternative_readmore) : ?>
<?php echo $item->alternative_readmore; ?>
<?php elseif ($params->get('show_readmore_title', 0)) : ?>
<?php echo sprintf(
Text::_('JGLOBAL_READ_MORE_TITLE'),
HTMLHelper::_('string.truncate', $item->title, $params->get('readmore_limit'))
); ?>
<?php else : ?>
<?php echo Text::_('JGLOBAL_READ_MORE'); ?>
<?php endif; ?>
</a>
</p>
<?php if (isset($item->link) && $item->readmore != 0 && $params->get('show_readmore')) : ?>
<?php if ($params->get('show_readmore_title', '') !== '') : ?>
<?php $item->params->set('show_readmore_title', $params->get('show_readmore_title')); ?>
<?php $item->params->set('readmore_limit', $params->get('readmore_limit')); ?>
<?php endif; ?>
<?php echo LayoutHelper::render('joomla.content.readmore', ['item' => $item, 'params' => $item->params, 'link' => $item->link]); ?>
<?php endif; ?>
</div>
<?php endif; ?>
Expand Down

0 comments on commit a81d79c

Please sign in to comment.