Skip to content

Commit 4b41186

Browse files
authored
Truncate text (joomla#44189)
1 parent 2018b69 commit 4b41186

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

modules/mod_articles/src/Helper/ArticlesHelper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Joomla\CMS\Date\Date;
1717
use Joomla\CMS\Event\Content;
1818
use Joomla\CMS\Factory;
19-
use Joomla\CMS\HTML\Helpers\StringHelper as SpecialStringHelper;
2019
use Joomla\CMS\HTML\HTMLHelper;
2120
use Joomla\CMS\Plugin\PluginHelper;
2221
use Joomla\CMS\Router\Route;
@@ -368,7 +367,7 @@ public function getArticles(Registry $params, SiteApplication $app)
368367
}
369368

370369
if ($introtext_limit != 0) {
371-
$item->displayIntrotext = SpecialStringHelper::truncate($item->introtext, $introtext_limit, true, false);
370+
$item->displayIntrotext = HTMLHelper::_('string.truncateComplex', $item->displayIntrotext, $introtext_limit);
372371
}
373372
}
374373

modules/mod_articles/tmpl/default_items.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@
104104
<?php echo $item->event->beforeDisplayContent; ?>
105105

106106
<?php if ($params->get('show_introtext', 1)) : ?>
107-
<?php echo $item->introtext; ?>
107+
<?php echo $item->displayIntrotext; ?>
108108
<?php endif; ?>
109109

110110
<?php echo $item->event->afterDisplayContent; ?>
111111

112-
<?php if (isset($item->link) && $item->readmore != 0 && $params->get('show_readmore')) : ?>
112+
<?php if ($params->get('show_readmore')) : ?>
113113
<?php if ($params->get('show_readmore_title', '') !== '') : ?>
114114
<?php $item->params->set('show_readmore_title', $params->get('show_readmore_title')); ?>
115115
<?php $item->params->set('readmore_limit', $params->get('readmore_limit')); ?>

0 commit comments

Comments
 (0)