ez.no / ezpublish / documentation / reference / modules
These documentation pages are no longer maintained. Please visit the new documentation site.
The eZ publish kernel consists of a collection of engines. Each engine is dedicated to a specific category of tasks. For example, the content engine takes care of everything that has to do with the management of the content node tree; the user engine takes care of login/logout, etc. Some of the functionality that is provided by these engines can be reached by the way of modules. In other words, a module can be thought of as an interface to an engine inside the kernel. A module provides a set of views. A view can be thought of as an HTML interface to a module. By using views, it is possible to reach various functions that a module provides. It is important to understand that a module usually does not provide the functionality itself (unless it is something very simple), it simply wraps kernel functionality by the way of views.
This part of the documentation contains an overview of all the modules and the views that they provide. Modules and views that are commonly used are documented better than modules and views that are specific to the administration interface. eZ publish provides the following modules:
Click on the name of a module for more information and to see a list of the module's views. It is also possible to browse all the modules and views that are available.
People who wish to build a "regular/normal" eZ publish site (not replicating the advanced functionality of the administration interface, not modifying kernel code, etc.) only need to use the following modules: content, layout, user, form, shop. These modules and their views will be documented in detail. The rest of the modules are used either internally or by the administration interface. These modules will not be described in detail since they are only used by experts who know how to figure it out anyway. The actual code for each module is located inside the "/kernel/[name_of_module]" directories. The following text sheds some light on the execution of modules, URL issues, views, view parameters, POST parameters, etc.
The URL (in particular the part after index.php) reveals which module that should be accessed. The following lines show a couple of example requests:
http://www.example.com/index.php/content/view/full/44 http://www.example.com/index.php/user/login
In the first example, it is the content module that will be accessed. In the second example it is the user module that will be accessed. Obviously, some additional information is also specified; in the examples above this is "view/full/44" and "login". The following text explains about these things. There is also a section about eZ publish URLs within the "eZ publish basics" chapter.
Every module consists of a set of so called views. A view can be thought of as an interface to a module. By using views, it is possible to reach various functions that a module provides. For example, among other things, the content module provides functions for adding, viewing and editing content. In a URL, the name of the view that should be executed appears after the name of the module (prepended by a slash). In the first example (see above), eZ publish is instructed to execute the view named "view" inside the content module. In the second example, eZ publish is instructed to execute the "login" view inside the user module.
When a view is called, eZ publish starts up the mechanism that is associated with that view. This mechanism then does some sort of operation (for example there is a mechanism that extracts content from the database) by interfacing with an engine inside the kernel. When the view/operation has finished, the module (where the view lives) returns a result. This information is put inside a template variable named $module_result.content and is thus presented when the requested page is rendered (the $module_result.content variable is usually displayed from within the main template, the pagelayout.tpl file).
Some views make use of parameters. Such parameters appear after the name of the view in the requested URL (separated by a slash). The first example above demonstrates this. In this case, the "full" and "44" are parameters to the view function inside the content module. This simply tells eZ publish to generate a full display of node number 44 by using the view function inside the content module. The full display that has been generated will be available from within the $module_result.content template variable. The view in the second example (module: user, view: login) doesn't make use of any parameters.
To sum things up, we can state that every eZ publish URL can be broken down into the following components:
http://[...]/index.php/<module>/<view>/<view_parameters...>
Some views make use of parameters that are passed by the way of forms through the HTTP POST method. In particular, the action view inside the content module makes an extensive use of POST variables. Some views can only be called using the HTTP POST method (instead of HTTP GET).
Comments