Variables in pagelayout
The pagelayout template contains miscellaneous variables that can be used to display information about the state of the system and/or to control the output. The following table shows the available variables along with a brief description.
Variable | Type | Description |
---|---|---|
$access_type |
array |
The name of the siteaccess (as "name") and the ID number (as "type") of the access method that was used (1=URL, 2=Host, 3=Port). |
$anonymous_user_id |
integer |
The ID number of the content object that represents the anonymous user account (the default/standard value is 10). |
$current_user |
object |
The ezuser object of the user who is currently logged in. If no user is logged in, the anonymous user account will be used. |
$ezinfo |
array |
An array of three strings: "version", "version_alias" and "revision". These strings reveal basic information about the eZ publish release that is being used. |
array |
Contains information about the result (and the result itself) generated by the module/view that was executed. |
|
$navigation_part |
array |
A hash containing the name and the identifier (the keys are "name" and "identifier") of the current navigation part; for example: "Content structure" and "ezcontentnavigationpart". The navigation part is used by the administration interface to determine which part the user interacts with. |
$requested_uri_string |
string |
Contains the site specific part of the requested URL, for example: "content/view/full/44" (system URL) or "company/about" (virtual URL). |
$site |
array |
Contains miscellaneous information about the siteaccess that is being used (site name, design resource, meta tags, etc.) |
$ui_component |
string |
The user interface component which eZ publish uses while the current page is being shown. This variable is used by the administration interface. |
$ui_context |
string |
The user interface context in which eZ publish is in while the current page is being shown. This variable is used by the administration interface to distinguish between different modes (for example "navigation", "edit", "browse", etc.). |
$uri_string |
string |
The system version of the requested URL (for example "/content/view/full/13"). |
$warning_list |
array |
An array of warnings related to problems that were discovered when the page was rendered. |
$module_result
The $module_result array contains the result that was generated by the module/view which was executed. If eZ publish was instructed to display the contents of a node, the variable will contain additional information about the node that was requested. If eZ publish was instructed to do something else (practically anything that is not an actual node view), the result will not contain additional information. The following tables show the contents of the $module_result variable in the different scenarios.
The default $module_result
Element | Type | Description |
---|---|---|
content |
string |
The actual content (result of templates) that was generated by the requested view. |
path |
array |
An array of hashes containing information about the path which leads to the page that is currently being viewed. Each hash contains the following keys: "text", "url". The "text" element usually contains the name of the module/view (for example "Collected information"). The "url" element contains the address. The "url" key of the last element in the array is usually set to false. The standard page head template uses the path array to build the TITLE component of the HEAD section. In addition, the path array can for example be used to build breadcrumbs (a path with names (as hyperlinks) of pages/views that lead to the current page/view). |
is_default_navigation_part |
boolean |
Returns TRUE if the default navigation part is being used (the one which is set in PHP code). Returns FALSE if the navigation part of the current module/view has been reconfigured by the site administrator. This can be done by making use of the "NavigationPart" directive of the "[ModuleSettings]" section within a configuration override for "module.ini". |
navigation_part |
string |
The identifier of the current navigation part (for example "ezcontentnavigationpart"). This variable is used by the administration interface to determine which part the user interacts with. |
ui_context |
string |
The user interface context in which eZ publish is in while the current page is being shown. This variable is used by the administration interface to distinguish between different modes (navigation, edit, browse, etc.) |
ui_component |
string |
The user interface component which eZ publish uses while the current page is being shown. This variable is used by the administration interface. |
uri |
string |
Contains the site specific part of the requested URL, for example: "content/view/full/44" (system URL) or "company/about" (virtual URL). |
The $module_result when a node is being viewed
Element | Type | Description |
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
content |
string |
The actual content (result of templates) that was generated by the requested view. |
||||||||||||||||||||||||||||||||||||
view_parameters |
array |
An array of the parameters that were sent to the view (for example "limit", "offset", etc.). |
||||||||||||||||||||||||||||||||||||
path |
array |
An array of hashes containing information about the path of nodes which lead to the node that is currently being viewed. Each hash contains the following components:
The node being viewed will have its "url" and "url_alias" components set to false. In addition, the "node_id" will not be available. The path array can for example be used to build breadcrumbs (a path with names (as hyperlinks) of the objects referenced by the nodes that lead to the target/current node). |
||||||||||||||||||||||||||||||||||||
title_path |
array |
Almost the same as the "path" array (see above). When a node is being viewed, the standard page head template uses the "title_path" array to build the TITLE component of the HEAD section. |
||||||||||||||||||||||||||||||||||||
section_id |
string |
The ID number of the section which the object referenced by the node being viewed belongs to. |
||||||||||||||||||||||||||||||||||||
node_id |
string |
The ID number of the node that is being viewed. |
||||||||||||||||||||||||||||||||||||
navigation_part |
string |
Contains the name identifier of the current navigation part (for example "ezcontentnavigationpart"). This variable is used by the administration interface to determine which part the user interacts with. |
||||||||||||||||||||||||||||||||||||
content_info |
array |
Contains miscellaneous information about the node that is being viewed:
|
||||||||||||||||||||||||||||||||||||
integer |
The TTL (Time To Live) value of the result that was generated by the module's view (as seconds). A TTL of minus one means that the view cache should never expire. A TTL of zero means that the result should never be cached. |
|||||||||||||||||||||||||||||||||||||
is_default_navigation_part |
boolean |
Returns TRUE if the default navigation part is being used (the one which is set in PHP code). Returns FALSE if the navigation part of the current module/view has been reconfigured by the site administrator. This can be done by making use of the "NavigationPart" directive of the "[ModuleSettings]" section within a configuration override for "module.ini". |
||||||||||||||||||||||||||||||||||||
ui_context |
string |
The user interface context in which eZ publish is in while the current page is being shown. This variable is used by the administration interface to distinguish between different modes (navigation, edit, browse, etc.) |
||||||||||||||||||||||||||||||||||||
ui_component |
string |
The user interface component used by eZ publish while the current page is being shown. This variable is used by the administration interface. |
||||||||||||||||||||||||||||||||||||
uri |
string |
The site specific part of the requested URL, for example: "content/view/full/44" (system URL) or "company/about" (virtual URL). |
Balazs Halasy (15/02/2005 10:13 am)
Julia Shymova (30/04/2007 10:53 am)
Comments
variable type
Monday 03 October 2005 3:20:19 pm
Nicolas
A more complete $requested_uri_string ?
Wednesday 05 October 2005 4:39:57 pm
Patrick ALLAERT
20_contestants
displaying: $module_result.uri will show
/20_contestants/(offset)/10
which is really cool to use to keep the user on the "same page" when using different siteaccesses for different languages !
--
Patrick ALLAERT
Web Developer
http://www.dixite.com/