問題は、自作モジュールが機能しないことです。Joomla 3.0 で自作モジュールを作成しています。ここにmod_productsフォルダーを作成し、 mod_products.phpというファイルを作成しました。
mod_products.php - コード
defined('_JEXEC') or die;
require_once __DIR__ . '/helper.php';
$value = modProductsHelper::getproducts( $params );
require JModuleHelper::getLayoutPath('mod_products', $params->get('layout', 'default'));
その後、2番目のファイルhelper.phpコードを作成しました-
class modProductsHelper{
public static function getProducts( $params ){
return 'Products';
}
}
そして3番目はdefault.phpです
<?php
defined('_JEXEC') or die;
if($value!='') { ?>
<ul style="margin-left: 0px;" class="clients-list slides-list slide-wrapper">
<li class="slide">
<div class="product-image"><img src="images/product3.png" width="181" height="177"></div>
</li>
</ul>
<?php } ?>
次に、管理者パネルからインストールし、mod_productsモジュールに位置を指定して、次のようにindex.phpファイルに表示します。
<div class="grid_12 product_home">
<jdoc:include type="modules" name="position-3" />
</div>
しかし、サイトには表示されません。誰かが理由を知っていますか?
編集:mod_products.xml
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="3.0" client="site" method="upgrade">
<name>mod_products</name>
<author>Joomla! Project</author>
<creationDate>July 2004</creationDate>
<copyright>Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>3.0.0</version>
<description>MOD_PRODUCTS_XML_DESCRIPTION</description>
<files>
<filename module="mod_products">mod_products.php</filename>
<folder>tmpl</folder>
<filename>helper.php</filename>
<filename>mod_products.xml</filename>
</files>
<config>
</config>
</extension>