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

ezjscore template operators

The template operators the ezjscore extension adds: the packer operators for stylesheets and scripts, json_encode, xml_encode and node_encode for handing data to scripts, and has_access_to_limitation.

Download as PDF

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

On this page

ezjscore template operators

This page is for designers who use the operators of the ezjscore extension, the JavaScript and CSS foundation of Exponential. They are registered in extension/ezjscore/autoloads/eztemplateautoload.php.

Contents

  1. Packer operators
  2. Encoding for scripts
  3. has_access_to_limitation

Packer operators

ezscript, ezscript_require, ezscript_load, ezscriptfiles, ezcss, ezcss_require, ezcss_load, ezcssfiles: see The ezcss and ezscript operators and Loading stylesheets.

Encoding for scripts

OperatorReturns
json_encodethe value as JSON
xml_encodethe value as XML
node_encodea node as a simple structure (for scripts that need node data)

The CSP-safe way to give a script data is a JSON block:

<script type="application/json" id="mytheme-gallery">{json_encode( hash(
    'title', $node.name,
    'count', $node.children_count ) )}</script>

The media design passes its video consent texts this way (pagelayout/head/script.tpl). A block of type application/json is data, not code, so a strict Content Security Policy allows it.

has_access_to_limitation

Tells whether the current user has a policy with a given limitation; used by ezjscore-based admin interfaces. For designs, the user fetch functions are simpler (Role and policy operators).

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