Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the full HTML introtext of a Joomla article in the Articles Category module?

Tags:

php

joomla

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?

like image 429
Twoquestions Avatar asked Jul 12 '11 15:07

Twoquestions


2 Answers

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>
like image 139
6GWebDesign Avatar answered Oct 11 '22 22:10

6GWebDesign


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.

like image 30
Twoquestions Avatar answered Oct 11 '22 20:10

Twoquestions