How to get and output entries like this ( example event Agenda )
- day01
- —session time-span ( loops session timespan entries )
- ——session span entrie(s) ( one or multiple )
- ——session span entries ( one or multiple )
- ——session span entries ( one or multiple )
- —/session time-span
- —session time-span
- ——session span entries ( one or multiple )
- —/session time-span
- /day01
-day02 ........
If anyone has input on how to do something like this ( still having the template readable :) )
I would be very thankful.
edit : my template ended up looking like this .. added storing a lastday variable to get days in the loop .. ( perhaps it can be done even better - but it works like a charm thanks for the input guys )
Blockquote {!--keep track of previous day in order to check if we have a new day--} {exp:string:set name="lastDay"}just starting{/exp:string:set}
**strong text**
{exp:channel:entries channel="session_timeblocks" show_expired="yes" show_future_entries="yes" dynamic="no" limit="999" orderby="date" sort="asc"}
{!-- store start day and time of current entry for check later on --}
{exp:string:set name="currentDay"}{entry_date format="%d"}{/exp:string:set}
{exp:string:output random}
{if currentDay != lastDay}
{if lastDay != "just starting"}
-2-</div> {!-- close open session and day --}
{/if}
<div class="prog_day grid item{currentDay}" >-1-
<div class="prog_day_title" >{entry_date format="%D %j/%n"}</div>
{/if}
{/exp:string:output}
<div class="prog_time grid">
<div class="col-1-6">
<div class="module">
{entry_date format="%H:%i"} - {expiration_date format="%H:%i"}
</div>
</div>
<div class="prog_session col-5-6" >
<div class="module">
{exp:playa:children field="{cf_session_timeblock}"}
<h5>{title}</h5>
<ul class='foldable'>
<li>
{if cf_session_summary}
<div>
<h3>Summary</h3>
<p>{cf_session_summary}</p>
</div>
{/if}
</li>
</ul>
{/exp:playa:children}
</div>
</div>
</div>
{!--store current entries start day and time--}
{exp:string:set name="lastDay" random}{entry_date format="%d"}{/exp:string:set}
{if count == total_results}2</div>{/if}
{/exp:channel:entries}
Blockquote