Skip to main content

Multi-Version Support

Support for Joomla 3, 4, 5, and 6 (preparation) — all from a single codebase.

Key Capabilities

Compile separately for Joomla 3, 4, 5, and 6

One blueprint, many outputs — no code duplication

Version-specific placeholders resolved at compile-time

Native Joomla API usage per version

JCB auto-detects and maps version-dependent logic (e.g., class imports, structure changes)

No compatibility plugins or polyfills required

How It Works

JCB separates structural logic and references per Joomla version using its internal compilation engine and Joomla Power system (JPKs). Here's a simplified example:

Let’s say you reference a Joomla system class like:

Joomla___34690c75_1090_47eb_8c06_7228dc7eedd6___Power::_(...)

When compiled for Joomla 4, this resolves as:

use:

use Joomla\CMS\HTML\HTMLHelper;
...
HTMLHelper::_(...);

And for Joomla 3:

jimport('joomla.html.html');

The class aliasing and import rules are version-sensitive, so your compiled output never includes unnecessary legacy or forward-looking code.


Example Scenario

You’ve created a component that should run on Joomla 3, 4, and 5:
  • You define views, fields, templates, layouts, and logic using placeholders and JPKs
  • You select the desired Joomla version(s) during compilation
  • JCB generates individual installable packages per version, containing only the appropriate code for that version
This allows you to distribute your extension as:
Each package is optimized and version-pure.

CLI & GUI Compatibility

  • Use the JCB compiler GUI to select your desired output version
  • Use the CLI for automated multi-version builds
Example CLI command:
bash
php cli/jcb.php compile --version=4 --component=com_example
You can even chain builds for multiple versions in CI/CD pipelines.

Why This Matters

Joomla Powers (JPK system) is JCB’s elegant, low-maintenance way to future-proof your component code. It ensures native compatibility with evolving Joomla APIs — and lets you write cleaner, more maintainable extensions.

  • No bloated compatibility code
  • Clean separation of logic per Joomla release
  • Future-proofing: already compatible with Joomla 6’s planned structure

This feature is ideal for developers maintaining long-term stable extensions while also supporting the Joomla upgrade path across versions.