Hi,
The code I am using to display the tides is:
#if len($tides) > 0
<div class="col-12 col-lg-6 mb-4">
<div class="card">
<div class="card-body text-center">
</br><h2 class="h5-responsive $Extras.color-text">High Tide</h5>
<table class="table table-striped text-left">
<tr>
<td><b>Date</b></td></td><td><b>Time (local)</b></td><td><b>Height</b></td>
</tr>
#set $tides = $forecast.xtides
#for $tide in $tides
#set $height=$tide.offset.raw / 3.281
#if $tide.hilo == 'H'
<tr>
<td>$tide.event_ts.format("%a %d %b")</td>
<td>$tide.event_ts.format("%H:%M")</td>
<td>
#echo '%.2f' % $height
m </td>
</tr>
#end if
#end for
</table>
</div>
</div>
</div>
<div class="col-12 col-lg-6 mb-4">
<div class="card">
<div class="card-body text-center">
</br><h2 class="h5-responsive $Extras.color-text">Low Tide</h5>
<table class="table table-striped text-left">
<tr>
<td><b>Date</b></td></td><td><b>Time (local)</b></td><td><b>Height</b></td>
</tr>
#set $tides = $forecast.xtides
#for $tide in $tides
#set $height=$tide.offset.raw / 3.281
#if $tide.hilo == 'L'
<tr>
<td>$tide.event_ts.format("%a %d %b")</td>
<td>$tide.event_ts.format("%H:%M")</td>
<td>
#echo '%.2f' % $height
m </td>
</tr>
#end if
#end for
</table>
</div>
</div>
</div>
#else
<div class="col-sm">
<h5 class="h5-responsive $Extras.color-text">The tide forecast is currently unavailable.</h5>
</div>
#end if
This produces two columns of tides - one for high tide and one for low tide - for the next 12 days, however I want to only display the tides for the next seven days. I have tried various ways to do this but I can't seem to get the correct syntax and the Cheetah Generator skips processing due to errors.
Any idea what syntax I need to use to display seven days rather than 12? It must be something to do with the lines:
#set $tides = $forecast.xtides
#for $tide in $tides
Thanks,
Rory