I have solved this by using ctx parameters:
[code]
[#-- Assigns --]
[#-- Retreive currentChild number --]
[#assign currentChild = ctx.getAttribute('currentChild')]
[#if currentChild == 0]
[#assign activeState = "active"]
[/#if]
[#-- Rendering --]
<div class="[#if !cmsfn.editMode]carousel-item[/#if] ${activeState!""}">
<h4>${content.navigationTitle!"Set title"}</h4>
</div>
[#-- Set the context attribute to currentChild + 1 --]
${ctx.setAttribute('currentChild', currentChild + 1, 0)}[/code]
And in the containing component:
[code]
[#-- Assigns --]
[#assign childNumber = 0]
[#assign childrenAreas = cmsfn.children(content, "mgnl:area")!]
[#assign currentChild = 0 /]
${ctx.setAttribute('currentChild', currentChild, 0)}
[/code]
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=0d4a52e6-03bd-4b09-8313-cb731cedab1c
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------