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

Fetching a layout in templates

The fetch functions of the layouts engine (layout, resolve_layout, resolve_layout_for_node, rules_for_node, layout_summary_for_node and the admin ones), their parameters, drawing the result with explayouts/layout.tpl…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/templates/layouts-template-fetch.md

On this page

Fetching a layout in templates

This page is for designers who draw layouts of the layouts editor in a design. The fetch functions are defined in extension/explayouts/modules/explayouts/function_definition.php.

Contents

  1. The functions
  2. In the pagelayout
  3. For a node
  4. Debugging rules

The functions

FunctionParametersReturns
layoutidentifier (required)one layout by its identifier
resolve_layoutpath (optional)the layout the rules choose for the current request (or the path)
resolve_layout_for_nodenode_id (required)the layout the rules would choose for that node
rules_for_nodenode_idthe rules that match the node
layout_summary_for_nodenode_ida summary of the node's layout (used by the administration)
resolve_admin_layout, admin_layout_cache_key, admin_layouts_enabledmodule, viewthe admin4l frame's layouts

In the pagelayout

{def $page_layout = fetch( 'explayouts', 'resolve_layout', hash() )}
{if $page_layout}
    {include uri='design:explayouts/layout.tpl' layout=$page_layout module_result=$module_result}
{else}
    {$module_result.content}
{/if}
{undef $page_layout}

The else branch keeps pages without a matching rule working (doc/eng-us/bc/6.0/LAYOUTS.md, "How rendering actually works").

For a node

The starter design resolves the layout of the page's node only for full views, and keeps it only when it belongs to its design:

{def $pl_resolved = fetch( 'explayouts', 'resolve_layout_for_node', hash( 'node_id', $pl_node.node_id ) )}

(extension/cjw_themes_jumper/design/starter/templates/pagelayout.tpl).

Debugging rules

fetch( 'explayouts', 'rules_for_node', hash( 'node_id', $node.node_id ) ) lists what matched. The resolver caches its answer per path for explayouts.ini [ResolverSettings] CacheTTL seconds (Layout rules).

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