Datatype view templates
This page is for designers who change how a kind of field looks everywhere: every date, every image, every list of
related items. Each datatype has a view template in content/datatype/view/<datatype>.tpl, used by
attribute_view_gui.
Contents
The templates
design/standard/templates/content/datatype/view/ has one per datatype: ezstring.tpl, eztext.tpl, ezxmltext.tpl
(rich text), ezimage.tpl, ezbinaryfile.tpl, ezdate.tpl, ezdatetime.tpl, eztime.tpl, ezboolean.tpl,
ezinteger.tpl, ezfloat.tpl, ezprice.tpl, ezemail.tpl, ezurl.tpl, ezkeyword.tpl, ezselection.tpl,
ezcountry.tpl, ezauthor.tpl, ezmatrix.tpl, ezmedia.tpl, ezobjectrelation.tpl, ezobjectrelationlist.tpl,
ezuser.tpl and more. Extensions add their own (for example eztags).
Two examples
The text line, in full:
$attribute.data_text|wash( xhtml )Rich text prints the HTML its tag templates produced:
$attribute.content.output.output_textThe rich text's own markup comes from the tag templates in ezxmltags/ (Rich text templates).
Restyling for the whole design
Copy the template to the same path in your design and change the copy:
design/mytheme/templates/content/datatype/view/ezdatetime.tplEvery siteaccess using your design now draws dates your way. Keep the variables the original reads ($attribute) and
the parameters it accepts, since other templates pass them.
Restyling for one class or field
Use an override with Source=content/datatype/view/<datatype>.tpl and Match[class_identifier] and/or
Match[attribute_identifier] (attribute_view_gui).
Rules
- Wash what is not already HTML; do not wash rich text output.
- Keep the markup small and semantic: these templates run many times per page.
- Print nothing for an empty field, or let the caller test
has_content. - The kernel's templates say "DO NOT EDIT THIS FILE! Use an override template instead." Copy, never edit.
Related pages
- Datatype edit templates
- attribute_view_gui
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
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.