I'm having trouble creating a simple module. Currently using Joomla 5.2.2, I started off by cloning a module I wrote last year for Joomla 4.0 at the time and which does work well.
The thing is, this new module does not display anything, just like if the entry point had no effect. So, I replaced everything with the classic mod_foo content and, yet, nothing happens.
The module is activated, everything looks "normal" to me but just the title gets displayed. Is Joomla 5.2 so different or am I making a mistake anywhere?
Here's my module xml file:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="4.0" client="site" method="upgrade">
<name>Sales by category</name>
<author>Me</author>
<version>1.0</version>
<description>Sales by category</description>
<files>
<filename module="mod_sales_by_category">mod_sales_by_category.php</filename>
<folder>tmpl</folder>
<filename>mod_sales_by_category.xml</filename>
</files>
</extension>
Code: Select all
<?php
/**
* @package [PACKAGE_NAME]
*
* @author [AUTHOR] <[AUTHOR_EMAIL]>
* @copyright [COPYRIGHT]
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @link [AUTHOR_URL]
*/
// No direct access to this file
defined('_JEXEC') or die;
use Joomla\CMS\Helper\ModuleHelper;
require ModuleHelper::getLayoutPath('mod_sales_by_category', $params->get('layout', 'default'));
Code: Select all
<?php
/**
* @package [PACKAGE_NAME]
*
* @author [AUTHOR] <[AUTHOR_EMAIL]>
* @copyright [COPYRIGHT]
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @link [AUTHOR_URL]
*/
// No direct access to this file
defined('_JEXEC') or die;
echo 'I won!';
Thx