Path

7x / documentation / ez publish / technical manual / 3.8 / templates / the pagelayout / variables in pagelayout


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

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.

$module_result

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:

Key

Description

text

The name of the object referenced by the node.

url

The system URL of the node (for example "/content/view/full/44").

url_alias

The virtual URL of the node (for example "company/about_us").

node_id

The ID number of the node.

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:

Variable

Type

Description

node_id

string

The ID number of the node.

parent_node_id

string

The ID number of the parent node.

object_id

string

The ID number of the object referenced by the node.

class_id

string

The ID number of the class which the object is an instance of.

class_identifier

string

The identifier of the class which the object is an instance of (for example "forum_message").

offset

integer

The offset view parameter.

viewmode

string

The view mode that was used to display the node (for example "full", "line", etc.).

node_depth

string

The depth of the node in the content tree.

url_alias

string

The virtual URL of the node (for example "company/about_us").

persistent_variable

n/a

A variable set in one of the templates used by the view that was executed. Regardless of the caching mechanisms used, this variable will be available in the pagelayout. The type of the persistent variable depends on the value it contains. If the variable is not set, it will simply return a boolean FALSE.

class_group

array

The ID numbers of the class groups that the class (which the object being viewed is an instance of) belongs to. This variable is connected with a feature that makes it possible to create template overrides based on class groups.

By default the "class_group" always returns a boolean FALSE value because the class group override feature is turned off. It can be turned on by setting the "EnableClassGroupOverride" directive in the [ContentOverrideSettings] block of a configuration override for "content.ini" to "true".

cache_ttl

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)

Svitlana Shatokhina (28/11/2006 9:37 am)

Balazs Halasy, Svitlana Shatokhina


Comments

  • variable type

    The differents ID (node_id,section_id,parent_node_id) aren't integer instead off string ?
  • A more complete $requested_uri_string ?

    Accessing http://www.example.com/index.php/20_contestants/(offset)/10 and displaying the variable $requested_uri_string shows:

    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/
  • Shop module

    Am I wrong when I say that these information are not available when located in the shop. For example I can not access to the current_user of module_result when I am in the /shop/userregister/ page ...
  • Other modules and views

    What about the variables available in other modules and views?

    For example, how do I know all the variables I can use inside /user/register template override?