Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Full view

The full view, the template of a content page: what it receives ($node, $view_parameters, $language_code), a complete article example, the one h1, sub-items with paging, handing values to the pagelayout, caching rules…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/templates/full-view.md

On this page

Full view

This page is for designers who write the main template of content pages. When a visitor opens a page, the content module renders the node in the full view mode; the pagelayout then frames the result.

Contents

  1. What the template receives
  2. A complete example
  3. Children and paging
  4. Talking to the pagelayout
  5. Caching rules
  6. One full view per class

What the template receives

From kernel/classes/eznodeviewfunctions.php: $node, $viewmode, $language_code, $view_parameters (the (name)/value parts of the URL, for example offset), $node_path, $collection_attributes and $validation (for information collector forms), and $persistent_variable.

A complete example

{* override/templates/full/article.tpl *}
<article class="article"{include uri='design:parts/exp_content_direction.tpl' exp_locale_code=$language_code}>
    <header>
        <h1>{$node.name|wash}</h1>
        <p class="article-meta">
            <time datetime="{$node.object.published|datetime( 'custom', '%Y-%m-%d' )}">{$node.object.published|l10n( 'shortdate' )}</time>
        </p>
    </header>
    {if $node.data_map.intro.has_content}
        <div class="article-intro">{attribute_view_gui attribute=$node.data_map.intro}</div>
    {/if}
    {if $node.data_map.image.has_content}
        <figure>{attribute_view_gui attribute=$node.data_map.image image_class='large'}</figure>
    {/if}
    {attribute_view_gui attribute=$node.data_map.body}
</article>

(Check the attribute identifiers of your classes. parts/exp_content_direction.tpl is the kernel's part that prints lang="..." dir="rtl" for right-to-left content and nothing otherwise, from the locale code in exp_locale_code; see Right-to-left designs.)

Children and paging

{def $limit = 10
     $offset = first_set( $view_parameters.offset, 0 )|int
     $children = fetch( 'content', 'list', hash( 'parent_node_id', $node.node_id, 'sort_by', $node.sort_array,
                                                 'offset', $offset, 'limit', $limit ) )
     $total = fetch( 'content', 'list_count', hash( 'parent_node_id', $node.node_id ) )}
{foreach $children as $child}{node_view_gui content_node=$child view='line'}{/foreach}
{include uri='design:navigator/google.tpl' page_uri=$node.url_alias item_count=$total view_parameters=$view_parameters item_limit=$limit}

(Pagination). offset is part of the view cache key, so each page of the list is cached separately.

Talking to the pagelayout

The full view runs before the pagelayout. To tell it something (hide the side column, add a body class), set the persistent variable; to require a stylesheet only here, ezcss_require.

Caching rules

The full view is view-cached (CachedViewModes includes full):

  • nothing visitor-specific in it (names, baskets, "you are signed in");
  • currentdate()-based output frozen until the next publish; set a short cache_ttl if needed (Caching for designers).

One full view per class

The default node/view/full.tpl is generic; give each class its own with overrides (Tutorial: override a full view).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x