Extension development
Building extensions step by step: structure, settings, modules, templates, classes and contributing back.
216 pages
- Case study: porting a package from another project with credit How two extensions brought in outside code and credited it - sevenx_dse embedding a database tool from a chain of forks, expchangeclass merging two forks - and what to check in your own port.
- Datatypes A new kind of field for content classes: when to write one, how the kernel finds and registers it, the eZDataType life cycle, a verified rating datatype, and real ones to learn from.
- Inline CSS to stylesheets Move an old extension's style blocks and style attributes into stylesheet files loaded through design.ini, so the packer bundles them and a Content Security Policy with style-src self does not drop them.
- Linking versus copying: citing sources fairly When to link to a source, when to quote it, when you may copy and adapt it, and how to give credit in code comments, READMEs, documentation and commit messages - with the patterns this project uses.
- By hand: a cronjob part Add a nightly digest to mysite_hello - a CronjobPart class, the one-line script, a part of its own in cronjob.ini, running it with runcronjobs.php and scheduling it in the crontab. All PHP files passed php -l.
- Case study: a pull request to an upstream author A real pull request to another organization's project, read section by section: what was broken, the one-line fix, the kept security intent, tests that fail without it, and what was not checked.
- Content classes for builders Designing the content model - classes, attributes, datatypes, identifiers, object name patterns, containers - and how the model connects to templates, overrides and fetches, with rules that keep it maintainable.
- Datatype storage, validation and templates The complete rating datatype: storage columns, validating posted input safely, values across versions, search and sorting, and the edit and view templates, all verified.
- Evaluating an old extension before you use it A checklist with commands to judge an extension you did not write: license, PHP 8 syntax, removed functions, access checks, escaping, SQL, inline scripts and database changes.
- From YUI to expui YUI 2 and 3 are gone from Exponential 6.0.15. Find an old extension's YUI code and move it to jQuery and Exponential UI (expui): server calls, dialogs, tables, date pickers and events.
- By hand: your own table with eZPersistentObject A greetings table: an engine-neutral db_schema.dba, the SQL the kernel generates from it for three databases, installing it, the class, and using it from a page.
- From old jQuery to jQuery 4 Load the jQuery 4 that ezjscore provides instead of a bundled old copy, and replace the jQuery calls that versions 3 and 4 removed, with the list the layouts editor went through and jQuery Migrate as a safety net.
- Learning from an extension, step by step Two real extensions taken apart file by file: str_replace, one operator in its 2005 shape with a PHP 8 bug and its one-line fix, and owsimpleoperator.
- Sections, roles and access for builders Who may see and do what - sections, object states, roles, policies, limitations and assignments - explained for builders, with a members-only area as a worked plan and the template operators that ask about access.
- Workflow event types Add a step to workflows: an eZWorkflowEventType class, its registration and triggers, execute() and the statuses it can return, process parameters, a verified example.
- admin4 styling for extension pages Make an old extension's admin pages look like the rest of admin4 - shared a4 components, tokens only, dark mode, no inline CSS - with the explayouts_ui template editor as a real before and after.
- By hand: an ezjscore server function Answer an ajax call: ezjscServer settings, a server function class, a script that calls it with Exp.io and writes with textContent, a policy for it, and testing the address.
- Debug output and logs for developers See what the system does while it builds a page: the Exp Debug bar and its settings, used templates, path comments, the log files under var/log, and your own debug lines and logs from PHP.
- Triggers and workflows for developers How operations, triggers and workflows connect: operation definitions, making more operations triggerable, running an operation from PHP, and what happens to deferred processes.
- Workflows for builders Make something happen around publishing: workflows, events, triggers, processes and the workflow cronjob, explained for builders, with an approval workflow and the event types that need no code.
Documentation license
This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.
Exponential Copyright © 1998-2026 Exponential Foundation and 7x