Core module providing base infrastructure and foundation for all JustBetter Magento 2 modules.
Report Bug
·
Request Feature
Table of Contents
This module by JustBetter provides core infrastructure and shared functionality that other JustBetter Magento 2 modules depend on. It serves as the foundational layer for all JustBetter extensions, providing a unified admin experience and centralized management.
Thanks to all the people who have contributed to this project:
This module provides the following features for JustBetter extensions:
- Unified Admin Menu: A centralized "JustBetter" menu item in the Magento admin panel for quick access to all JustBetter extension configurations
- Configuration Tab: A dedicated "JustBetter Extensions" tab in System Configuration to group all extension settings
- Extensions Overview: An admin panel displaying all installed JustBetter extensions with version information and GitHub links
This module is automatically installed as a dependency when installing any JustBetter module that depends on it.
After installation, enable the module:
bin/magento module:enable JustBetter_Core
bin/magento setup:upgrade && bin/magento cache:flushThis section describes how other JustBetter extensions can integrate with the Core module to provide a consistent user experience across all JustBetter modules.
Add the Core module as a dependency in your extension's composer.json:
{
"require": {
"justbetter/magento2-core": "^1.0"
}
}Define the module sequence in etc/module.xml to ensure proper loading order:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="JustBetter_YourModule">
<sequence>
<module name="JustBetter_Core"/>
</sequence>
</module>
</config>All packages with the justbetter/* vendor prefix are automatically detected and displayed in the Extensions overview within the admin panel. No additional configuration is required for your extension to appear in this list.
The extensions list displays:
- Package name with link to GitHub repository
- Installed version (from
composer.lock)
To add your extension to the centralized JustBetter admin menu, create etc/adminhtml/menu.xml. The menu uses a section header with submenu items structure:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<add id="JustBetter_YourModule::section"
title="Your Module"
module="JustBetter_YourModule"
translate="title"
sortOrder="40"
parent="JustBetter_Core::menu"
resource="JustBetter_YourModule::menu"/>
<add id="JustBetter_YourModule::config"
title="Configuration"
module="JustBetter_YourModule"
translate="title"
sortOrder="10"
action="adminhtml/system_config/edit/section/yourmodule_settings"
parent="JustBetter_YourModule::section"
resource="JustBetter_YourModule::config"/>
</menu>
</config>To place your extension's configuration under the "JustBetter Extensions" tab in System Configuration, create etc/adminhtml/system.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="yourmodule_settings" translate="label" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Your Module</label>
<tab>justbetter</tab>
<resource>JustBetter_YourModule::config</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>General Settings</label>
<!-- Add your configuration fields here -->
</group>
</section>
</system>
</config>Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
Development:
# Run quality checks (PHPStan)
composer analyse
# Run GrumPHP tasks manually
composer grumphpNote: GrumPHP runs automatically on git commit.
For security vulnerabilities, please see our Security Policy.
Distributed under the GPL-3.0 License. See LICENSE for more information. Please see License File for more information.