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

attribute template operator

The attribute template operator: 3 parameter(s), registered by eZTemplateAttributeOperator.

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/examples/template-operators/attribute.md

On this page

The attribute template operator

Registered in lib/eztemplate/classes/eztemplateautoload.php by the class eZTemplateAttributeOperator (lib/eztemplate/classes/eztemplateattributeoperator.php). The same class also registers: dump.

Parameters

ParameterTypeRequiredDefault
show_valuesstringno''
max_valnumericalno2
formatbooleanno'html'

The operator works on its input: the value before |.

Example

Built from the parameter list above; the values are placeholders (the operator's template hints decide whether it takes an input).

{$value|attribute( 'show_values', 2, 'html' )}

In a shipped template

The first use in the templates of this installation, design/admin/templates/shop/dashboard.tpl line 240:

<p class="a4-shop-note">{'A class is a product class when it has a price attribute (%types). Only its published objects can be added to the basket.'|i18n( $ctx, , hash( '%types', 'ezprice, ezmultiprice' ) )}</p>

Generated by ./console exp:help:examples from lib/eztemplate/classes/eztemplateautoload.php, lib/eztemplate/classes/eztemplateattributeoperator.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

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