简体   繁体   English

如何检查在joomla 2.5中正在调用module1?

[英]how to check that module1 is being called in joomla 2.5?

i am trying to check whether module1 is called in virtue mart default page. 我试图检查是否在美德商城默认页面中调用了module1。

if module1 is being called i want to show product description for that module. 如果正在调用module1,我想显示该模块的产品说明。 when i tried to add description in default page it shows description in all virtue mart products modules. 当我尝试在默认页面中添加描述时,它会在所有美德超市产品模块中显示描述。

i am stuck at this stage of my project where i am not able to catch module1 call in virtue mart page. 我被困在项目的这个阶段,在这个阶段我无法在美德集市页面上捕获module1调用。

how can i check for this module1 call? 我如何检查此module1呼叫?

here is code for description: 这是描述代码:

// 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
}

Go to ../modules/mod_virtuemart_product/tmpl/default.php 转到../modules/mod_virtuemart_product/tmpl/default.php

This file copy to create new file in this you add or remove code. 此文件副本可在其中添加或删除代码以创建新文件。 And after go to administrator select or create module. 然后去管理员选择或创建模块。 then select layout drop down at right side of screen your new created file. 然后在屏幕右侧选择版式下拉菜单,以创建新文件。

it's working. 它正在工作。

By default joomla could check if a module exist in a specific position. 默认情况下,joomla可以检查模块是否位于特定位置。

So if you add your module in a position that doesn't have any other modules you could use: 因此,如果您将模块添加到没有其他模块的位置,则可以使用:

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

You could check here the complete documentation 您可以在这里查看完整的文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM