Joomla 模块在文章中可见但在类别中不可见

Joomla module visible in article but not in category

我对 Joomla! 有疑问。有没有办法设置某个模块在特定类别中可见但在文章中不可见? (因此它将显示在类别页面上,但不会显示在该类别或子类别的文章中) 我在以前的作品中遇到了相反的问题,并用 index.php 中的一些猫 ID 和 php 修复了它,但我不知道如何实现这种效果,那里有人有同样的问题吗?修复了吗?

此致

这个有用吗? 我没有在 Joomla 上开发,但我发现了这个 link.

http://www.inmotionhosting.com/support/edu/joomla-25/extensions/modules-on-homepage

在 template/your_template/html/ 文件夹中创建类别视图的覆盖,并在覆盖文件中使用以下代码:

<?php
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('modules');
$position = "YOURPOSITIONNAME";
$options = array('style' => 'raw');
echo $renderer->render($position, $options, null);
?>

为什么不使用 Advanced Module Manager,它有几个适合您要求的高级选项 https://www.regularlabs.com/extensions/advancedmodulemanager#free-vs-pro