Element
This object represents an element in catalogue elements list.
Every element page has this property accessible from element
property.
Every page with elements type template has property elements
containing array of element objects bound to the page. Elements list can be obtained also by using {{ elements_context }}
tag from all pages. See more from elements listing template example and element page template example.
Common properties for all elements
element_definition_id
new_record?
Returns true if element is not yet saved to server. Useful if content areas will additionally be bound to element. If element is new this binding should not be done as the element to bind it to does not exist.
{% unless element.new_record? %} {% content name="element_gallery" bind="Element" %} {% endunless %}
page
Returns the page object of elements page where current element is located.title
Returns title of element. Property can be made user editable in template:{% editable element.title %}
url
Returns URL for given element.
User defined properties
All user defined properties of element definition are accessible directly as element properties.
If user has defined a property with code description
, editable tag for this in elements template would be:
{% editable element.description %}
- Basics
- Variables
- Filters
- Components
- Localization
- Keyboard shortcuts
- Objects
- Article
- Asset
- Blog
- Comment
- Element
- Language
- Mediaset
- Menu item
- Page
- Person
- Site
- Tag
- Data
- Tags
- addbutton
- assign
- blogcontext
- case
- capture
- commentform
- content
- contentblock
- cycle
- editable
- elementscontext
- for
- grouped
- if
- ifchanged
- image
- include
- load
- login
- loginblock
- menuadd
- menubtn
- menulink
- reorder
- rss_link
- stylesheet_link
- unless
- xcontent
- Examples
- Creating a navigation menu
- Creating language selection
- Blog page example
- Blog article example
- Complete page example
- Breadcrumbs
- Standard theme definition
- Elements listing
- Element page
- Components