Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2130

Joomla! 5.x Coding • Help with Custom Module

$
0
0
Hi,
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:

<?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>
My main entry point looks like this:

Code:

<?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 filedefined('_JEXEC') or die;use Joomla\CMS\Helper\ModuleHelper;require ModuleHelper::getLayoutPath('mod_sales_by_category', $params->get('layout', 'default'));
and my default.php file is:

Code:

<?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 filedefined('_JEXEC') or die;echo 'I won!';
Since I'm not an in-depth Joomla guru, any help would be greatly appreciated!

Thx

Statistics: Posted by Phil91 — Tue Dec 03, 2024 5:15 pm



Viewing all articles
Browse latest Browse all 2130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>