On the front page of a client's site, I'd like to display a few article samples with images and headers. Trouble is, the article object strips out all HTML from the introtext before displaying it in the Articles Category module.
Is there a way to display the module's introtext with all the HTML left in?
In version 3.2 you can bypass the _cleanIntrotext method by setting the introtext display option to "hide".
Create an alternate layout (or override default.php) in /templates/your_template/html/mod_articles_category and change
<?php if ($params->get('show_introtext')) :?>
<p class="mod-articles-category-introtext">
<?php echo $item->displayIntrotext; ?>
</p>
<?php endif; ?>
to
<p class="mod-articles-category-introtext">
<?php echo $item->introtext; ?>
</p>
I finally found an answer. Turns out on ~siteroot~/modules/mod_articles_category/helper.php
has a _cleanIntrotext
function that strips out most html from the introtext. Commenting out the str_replace
and strip_tags
lines fixed my problem right up.
It's not the greatest way to fix this, as I'll have to remember to reimplement this when I upgrade Joomla.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With