- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Determine first, last or count of a module
SOLVEMar 6, 2018 11:23 AM
Is there a way to get the count for each instance of a custom module?
Say a module is this
</div> </div> </div> <div class="row-fluid-wrapper"> <div class="row-fluid"> <div class="span12">
Is there a way to say on the first instance do this?
{% unless moduleCount == '1' %} </div> </div> </div> {% endunless%} <div class="row-fluid-wrapper"> <div class="row-fluid"> <div class="span12">
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Accepted Solutions
Jul 6, 2018 10:54 AM
So Ive found a work around but it really feels like a hack and additional effort for my marketing team. It also leaves room for error.
A user will need to know the set the appropriate check box (first_container, last_container) to set the divider section as either the first of last item.
this will then dictate if the closing and opening html is rendered on the template.
{% unless module.first_container %} </div><!--end widget-span --> </div><!--end row--> </div> {% endunless %} {% unless module.last_container %} <div class="row-fluid-wrapper new-section {{ module.background.color }}" id="{{ module.section.id|replace(' ', '')|lower) }}"> <div class="row-fluid page-center {{ module.section.width }}"> <div class="span12"> {% endunless %}
This means I can provide a template that consitists of a single flexible column. This divider section module can be dropped in where required. This will create a new section in the page with custom display settings to suit the design.
The reason for looking at a solution for this is to provide marketing staff and content editors a little of the freedom of the template generator in the design manager, without the required knowledge, so they can generate the layout the need with the modules provided.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content