This is a simple example frontend module for Joomla! 4.x / 5.x / 6.x. It shows Joomla! Content. This module can be used as Blueprint.
- New Joomla! Module Structure Example Code
- Example Code for WebAssets (JS / ES6 Modules / CSS)
- Example Code for Language Files
- Example Code for Frontend Ajax Request
- Use Composer to set up and deploy the module
- Clone the repository
- Run
composer setupby typingcomposer run-script setupin a new terminal window to rename the module and set up the module - Run
composer deploy [mod_name]by typingcomposer run script deploy [mod_name]in a new terminal window where the name is your module name previously defined in the setup - Optional: Copy the module folder and create a new Project in your IDE
- Optional: Install the module via Joomla! Extension Manager
- Search & Replace all occurrences of
mod_blueprintwith your module name - Search & Replace all occurrences of
BluePrintwith your module title (used for namespacing & naming in Language files) - Search & Replace all occurrences of
blueprintwith your module name in lowercase - Search & Replace all occurrences of
BLUEPRINTwith your module name in uppercase
- Search & Replace all occurrences of
[CREATOR-COMPANY]with your Company's Name - Search & Replace all occurrences of
[CREATOR-URL]with your Company's URL - Search & Replace all occurrences of
[CREATOR-FULLNAME]with your Name - Search & Replace all occurrences of
[CREATOR-EMAIL]with your Email - Search & Replace all occurrences of
[CREATED-DATE]with the current date - Search & Replace all occurrences of
[CREATED-YEAR]with your Copyright - Search & Replace all occurrences of
[EXTENSION-VERSION]with the current version
- Search & Replace all occurrences of
NXDwith your Company's ID (used for namespacing) - Rename mod_blueprint.xml to your module name (e.g. mod_example.xml)
- Rename the Language File language/en-GB/en-GB.mod_blueprint.ini to your module name (e.g. en-GB.mod_example.ini)
- Rename the Language File language/en-GB/en-GB.mod_blueprint.sys.ini to your module name (e.g. en-GB.mod_example.sys.ini)
- Rename the Helper File src/Helper/BluePrintHelper.php to your module name (e.g. src/Helper/ExampleHelper.php)
- Rename the Media Folder media/mod_blueprint to your module name (e.g. media/mod_example)
After the setup has been done, you are good to go and can modify the module to your needs.
Your module has been created within the customized directory. Go ahead and do your thing!
After the Setup process is done, you can run composer deploy [mod_name] by typing
composer run script deploy [mod_name] in a new terminal window where the name is your module name previously defined
in the setup.
- Delete composer.json, composer.lock, the vendor and .git folder as they are not needed for the module
- Zip the module and install it via Joomla! Extension Manager