Declaring dependencies in extension.xml
This page is for designers whose theme needs or builds on another extension.
The block
cjw_newsletter declares that it extends ezwt:
<software>
<metadata>...</metadata>
<dependencies>
<extends>
<extension name="ezwt" />
</extends>
</dependencies>
</software>The three kinds
The kernel reads the block in ezpExtension::getLoadingOrder() (kernel/private/classes/ezpextension.php):
| Element | Loads your extension | Use it for |
|---|---|---|
<extends> | before the named one (yours wins) | A theme that overrides templates or settings of a base theme |
<requires> | after the named one | Something your theme cannot work without, for example a layouts engine |
<uses> | after the named one | Something your theme uses when present |
The order is applied when site.ini [ExtensionSettings] ExtensionOrdering=enabled. It only orders extensions that
are active: declaring <requires> does not activate the other extension, and the kernel still loads yours if the
other one is missing. Say in your README what has to be installed and active.
Step by step
- Decide for each other extension: does your theme override it (
extends) or rely on it (requires,uses)? - Add the block to
extension.xmlafter<metadata>. - Check the file:
xmllint --noout extension/mytheme/extension.xml(no output expected). - Clear the INI cache and look at Setup > Extensions: the card shows the real loading position.
- Add the same dependencies to
composer.json(requireorsuggest) so Composer installs them (require and suggest).
A broken extension.xml is reported in the debug output and its loading order is ignored, so step 3 matters.
Related pages
- Loading order and which theme wins
- extension.xml: the packaged description
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.