Path

ez.no / documentation / tutorials / developing ez publish exten... / what are ez publish extensions


Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

What are eZ Publish extensions

Before talking about the example extension, I will explain the concept of extensions and talk about the structure of extensions.

An extension provides additional functionality (or extends existing functionality) in eZ Publish. It is called an extension because it plugs in to the eZ Publish core without requiring modifications to the original files. By placing new functionality in an extension, you can upgrade the eZ Publish version without affecting the extension.

Some examples of what you can do with extensions:

  • save the design of a website / siteaccess
  • create custom modules with new views and template fetch functions
  • extend the template system with custom template operators
  • program new workflow events, datatypes or login handlers

Extensions in eZ Publish usually adhere to a standard directory structure, as outlined in Table 1 below.

Extension subdirectory

Description

actions/

New actions for forms

autoloads/

Definitions of new template operators

datatypes/

Definitions for new datatypes

design/

Files (*.tpl, *.css, *.jpg, *.js ...) related to the design

eventtypes/

Custom workflow events

modules/

One or more modules with views, template fetch functions, and so on

settings/

Configuration files (*.ini, *.ini.append.php)

translations/

Translation files (*.ts)

Table 1: Standard directory structure of an eZ Publish 4.x extension

The directory structure shown above is only an example. The actual directory structure you use depends on the type of extension. Some directories may not be necessary. For example, a Template Operator extension only requires the directories autoloads/ and settings/; in a module extension, only the directories modules/ and settings/, and maybe a design/ directory, are required.