Skip to content

Commit

Permalink
updated default columns con Joomla 4
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbearman committed Sep 10, 2021
1 parent 59638f5 commit beac244
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ abstract class ContentHelperRoute extends \Joomla\Component\content\Site\Helper\
if (version_compare(JVERSION, '4', 'lt')) {
JHtml::_('behavior.caption');
}
$this->columns = !empty($this->columns) ? $this->columns : $this->params->get('num_columns');
$this->columns = !empty($this->columns) ? $this->columns : $this->params->get('num_columns',1);
if(!$this->columns) $this->columns = 1;

// If the page class is defined, add to class as suffix.
// It will be a separate class if the user starts it with a space
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,38 +78,19 @@
<?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?>
<?php endif; ?>

<?php if ($params->get('show_readmore') && $this->item->readmore) :
<?php if ($params->get('show_readmore')) :
if ($params->get('access-view')) :
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
else :
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId);
$returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid));
$link = new JURI($link1);
$link->setVar('return', base64_encode($returnURL));
endif;
?>
<section class="readmore">
<a class="btn btn-default" href="<?php echo $link; ?>" itemprop="url">
<span>
<?php if (!$params->get('access-view')) :
echo Text::_('COM_CONTENT_REGISTER_TO_READ_MORE');
elseif ($readmore = $this->item->alternative_readmore) :
echo $readmore;
if ($params->get('show_readmore_title', 0) != 0) :
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
endif;
elseif ($params->get('show_readmore_title', 0) == 0) :
echo Text::sprintf('COM_CONTENT_READ_MORE_TITLE',$this->item->title);
else :
echo Text::_('COM_CONTENT_READ_MORE');
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
endif; ?>
</span>
</a>
</section>
$link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false));
$link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)));
endif; ?>

<?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>

<?php endif; ?>
</article>
<!-- //Article -->
Expand Down

0 comments on commit beac244

Please sign in to comment.