Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/247.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何检查joomla 2.5中是否调用了模块1?_Php_Joomla_Virtuemart - Fatal编程技术网

Php 如何检查joomla 2.5中是否调用了模块1?

Php 如何检查joomla 2.5中是否调用了模块1?,php,joomla,virtuemart,Php,Joomla,Virtuemart,我试图检查模块1是否在默认页面中被调用 如果调用模块1,我想显示该模块的产品描述。 当我尝试在默认页面中添加说明时,它会在所有美德超市产品模块中显示说明 我被困在我的项目的这个阶段,我无法在页面中捕捉模块1的调用 我如何检查模块1呼叫 以下是描述代码: // Product Description if (!empty($this->product->product_desc)) { ?> <div class="product-description">

我试图检查模块1是否在默认页面中被调用

如果调用模块1,我想显示该模块的产品描述。 当我尝试在默认页面中添加说明时,它会在所有美德超市产品模块中显示说明

我被困在我的项目的这个阶段,我无法在页面中捕捉模块1的调用

我如何检查模块1呼叫

以下是描述代码:

// Product Description
if (!empty($this->product->product_desc)) {
?>
    <div class="product-description">
        <?php /** @todo Test if content plugins modify the product description */ ?>
            <span class="title"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE') ?></span>
        <?php echo $this->product->product_desc; ?>
    </div>
<?php
}
//产品说明
如果(!empty($this->product->product_desc)){
?>
去
../modules/mod_virtuemart_product/tmpl/default.php

此文件复制以在此文件中创建新文件,您可以添加或删除代码。 然后转到管理员选择或创建模块。 然后选择屏幕右侧的布局下拉列表,以显示新创建的文件


它正在工作。

默认情况下,joomla可以检查模块是否存在于特定位置

因此,如果您将模块添加到没有其他模块的位置,您可以使用:

<?php if ($this->countModules( 'user1' )) : ?>
  Module exist
<?php endif; ?>

模块存在