Skip to content

Element

Definition

An element represents an individual component in templates. Unlike items, elements do not repeat on the same page as a list. They are used for standalone components that appear consistently across multiple templates.

If a component repeats across multiple templates, an element file can be created for it.

An example of an element component is a search bar for a specific page.

Example

<div class="col-lg-3 col-12">
    {% include 'django_spire/element/attribute_element.html' with attribute_title='Recipe Name' attribute_value='Chocolate Cake' %}
</div>