Ez publish template variables




















Just like the "def" and "undef" functions, the "set" function can work with multiple variables at the same time. For more information, please refer to the documentation page of the "set" function.

Global variables are changed just like a regular variable, but in this case we will need to use the scope parameter to declare it a global variable. For more information, please refer to the documentation page of the "set" template function. This method is called "index lookup".

The elements of an associative array can be accessed by using the key identifiers. This method is called "identifier lookup". The following example demonstrates the different lookup methods. Index look-up may also be carried out by appending a matching pair of brackets that encapsulate the desired index value.

The following example demonstrates how to access the elements of a simple array using index look-up. Please note the different syntaxes dot and brackets.

The 1st element is: Life The 2nd element is: is The 3rd element is: very The 4th element is: good! Identifier look-up may also be carried out by appending a matching pair of brackets that encapsulate the desired index value.

The following example demonstrates how to access the elements of an associative array using the identifier look-up method. Notice the different syntax use of dot and brackets.

The attributes of an object can only be accessed using the attributes' identifiers. An identifier is just the name of an attribute similar to the keys of an associative array. The following example demonstrates how the different attributes of a node object can be accessed from within a template. Path ez. Table of contents. This can be done by making use of the "NavigationPart" directive of the "[ModuleSettings]" section within a configuration override for "module.

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.

This variable is used by the administration interface to distinguish between different modes navigation, edit, browse, etc. An array of the parameters that were sent to the view for example "limit", "offset", etc. 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:. Almost the same as the "path" array see above. Contains the name identifier of the current navigation part for example "ezcontentnavigationpart". The view mode that was used to display the node for example "full", "line", etc.

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. 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. It can be turned on by setting the "EnableClassGroupOverride" directive in the [ContentOverrideSettings] block of a configuration override for "content. 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. The user interface component used by eZ publish while the current page is being shown.

Read the cookbook recipe to learn more about it. Matches the unique block identifier defined in the legacy block. For example with the following configuration in legacy block. See field rendering documentation for more information. Layout template. Goal of a layout template is to display zones for the given layout, depending on your layout configuration.

Each zone contain blocks that hold your content as block items. To render blocks from a layout template, you need to do a sub-request. However, if you do so, you might need to get access to the PageService. You can get it via the service container with identifier ezpublish. This controller is responsible of choosing the right template for your block, depending on the rules you defined. Hash of cache settings to use by the sub-controller useful if you use ESI or Hinclude strategies.

If no template selection rule is matched, the system will fallback to the legacy kernel and will use rules you might have defined in legacy. However, additional variables from the params argument won't be passed to the resulted template. And of course, all the additional variables you injected in the params argument. Usage of pageService is deprecated as of v5. This feature is available from eZ Platform 5. Or do i need something more?

Carlos: Yes updated the doc. Your comment also pointed out that the template identifier was wrong. You must use:. Node templates. System templates. The pagelayout. The page head. Variables in pagelayout. The template language. Variable types. Variable usage.



0コメント

  • 1000 / 1000