Hi,

I have the forecasting extension set up and working, and now have tides for 
my local port working on my ephemeris 
page: https://www.360shetland.co.uk/weather/almanac.html

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

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/9e2d7ca9-84e7-41a8-8e77-5b9981c45daen%40googlegroups.com.

Reply via email to