[英]How do I get the full HTML introtext of a Joomla article in the Articles Category module?
在客户网站的首页上,我想展示一些带有图像和标题的文章示例。 麻烦的是,文章 object 在文章类别模块中显示之前从介绍性文本中删除了所有 HTML。
有没有办法在所有 HTML 中显示模块的介绍性文本?
在 3.2 版中,您可以通过将 introtext 显示选项设置为“隐藏”来绕过 _cleanIntrotext 方法。
在 /templates/your_template/html/mod_articles_category 中创建替代布局(或覆盖 default.php)并更改
<?php if ($params->get('show_introtext')) :?>
<p class="mod-articles-category-introtext">
<?php echo $item->displayIntrotext; ?>
</p>
<?php endif; ?>
至
<p class="mod-articles-category-introtext">
<?php echo $item->introtext; ?>
</p>
我修改了线条
$item->fulltext = $item->introtext;
$item->introtext = self::_cleanIntrotext($item->introtext);
and use fulltext for html an introtext for only text.
$item->displayIntrotext = $show_introtext ? self::truncate($item->introtext, $introtext_limit) : '';
$item->displayFulltext = $show_introtext ? self::truncate($item->fulltext, $introtext_limit) : '';
我终于找到了答案。 原来~siteroot~/modules/mod_articles_category/helper.php
有一个_cleanIntrotext
function 从introtext EZ7 中删除大部分 ZFC35FDC70D5FC69D239883A8222C。 注释掉str_replace
和strip_tags
行解决了我的问题。
这不是解决此问题的最佳方法,因为我必须记住在升级 Joomla 时重新实现它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.