Appearance
Templating
Context
Specific context is injected for every specific template but global functions and context are available:
- app, application context
- request, current request
- uri, full requested uri
- request, current request
- wf_cms_publicUrl, public base site url
Extensions
Functions
modules_lens(modules, 'title.content')
, return the node following the given path ornull
if not exists.modules_traverse($modules, $state, $f, $role = null)
, traverse the modules tree enabling folding data, $f can be a function with signature function ($node, $state, $role) { return ... new state ...; } or a string defining only the body of that function, i.e. 'return ... new state ...;countModulesWords(modules)
, count the words following the word-count-config settings.xgo_get_page_by_slug(slug)
, return thepage
object from theirslug
value.xgo_get_tag_by_slug(slug)
, return thetag
object from theirslug
value.xgo_get_category_by_slug(slug)
, return thecategory
object from theirslug
value.xgo_get_root_categories()
, return all root (active) categories.page_count_content_models_type(modules, type)
, count how many times appear the contenttype
.wf_render_twig_template(template_name, context)
, render the given template using the given context.wf_load_image_by_sourceId(source_id)
, return theimage
object from theirsource_id
field.xgo_facet()
, infer the current facetxgo_facet_isAmp()
, true if the current facet is AMPpage_get_article_body(page)'
, get the body from a page to a stringxgo_download_url(url)
, download (maximum 5 seconds) an external resource.url_decode(url)
, bypass tourldecode
.url_encode(url)
, bypass tourlencode
.preg_replace(pattern, replacement, subject)
, bypass topreg_replace
.xgo_get_tag_by_id(id)
, return thetag
object from theirid
value.wf_setting_json_array_or(settingSlug, defaultArray = null): ?array
, read the setting and convert to json array using default if not settled.xgo_taghandler_add(['string'])
, adds cache xkeys, input example ['x-key-1', 'x-key-2']
Filters
md5
, compute the MD5 value.html2text
, convert to plain text the HTML value.text2htmlattr
, escapes special characters and encodes them based on $charset.