Editable regions for Categories
Evance has two reserved editable regions for Category templates, but you may add more if you wish.
Editable regions are added to a page using the <ev:editable/>
tag.
Primary & secondary content areas
Your Category template must include a primaryContent
region and may optionally include a
secondaryContent
region, which is usually placed either below product listings or as a
"read more" to the primary content.
<main>
<ev:editable ref="primaryContent" />
... product listsing, or read more...
<ev:editable ref="secondaryContent" />
</main>
Additional regions
You may add any number of additional sub-regions to your category templates. You have freedom over what you call your regions, but references should:
- contain alpha-numeric characters, dashes or underscores
- avoid the use of spaces
<main>
<ev:editable ref="primaryContent" />
</main>
<section>
<h2>Features</h2>
<ev:editable ref="features" />
</section>
Placeholder content
Product categories have subtly different requirements for editable regions to those in Page templates.
As a result, you should avoid adding placeholder content in editable regions for primaryContent
and secondaryContent
regions. However, additional editable regions on the page may contain placeholder content.
Dynamically generated regions
There may be instances where you need to dynamically generate editable regions for a category. The ref
attribute
for an <ev:editable>
tag supports basic use of EvScript, allowing you dynamically name references.
<?ev for (var asset of category.assets) { ?>
<ev:editable ref="asset-{{ asset.id }}">
<h3>{{ asset.title }}</h3>
<p>{{ asset.description }}</p>
<ev:editable>
<?ev } ?>
Additional reading
See the following related articles: