Webtags as boolean operators in HTML: Difference between revisions

m
Text replacement - "http://sandaysoft.com/forum/" to "https://cumulus.hosiene.co.uk/"
m (β†’β€ŽNew extremes: added note about slash variants)
m (Text replacement - "http://sandaysoft.com/forum/" to "https://cumulus.hosiene.co.uk/")
 
(4 intermediate revisions by one other user not shown)
All the [[Webtags#Alarms]] are boolean. Suppose you had an image of a bell ringing and gave it the filename '''bell_1.png'''. If a second image with the name '''bell_0.png''' showed someone asleep, then the following HTML code would pick the appropriate image relating to whether the weather station was communicating with Cumulus.
<img src="bell_<#DataStopped>.png">
NOTE: Some versions of HTML would require slightly different syntax (note space before slash)
<img src="bell_<#DataStopped>.png" />
but both will work in the latest HTML5.
 
== New extremes ==
An easy modification to [[Customised_templates | recordsT.htm]] is to add an image against each record that has just been updated with a new extreme. Again, you need two images perhaps looking like a light-emitting diode type indicator. In one image it would be off, in the other it would be coloured as if on. The next code extract uses two such pairs to place the right image beside the label, in this case grey for no new extreme, blue for a new minimum and red for a new maximum.
<th><img src="led_blue<#LowMaxTempRecordSet>.png" alt="O" />Lowest Daily Maximum</th>
<th><img src="led_red<#HighTempRangeRecordSet>.png" alt="O" >Largest Daily Range</th>
(again inclusion/exclusion of the space and slash at the end of the img element varies between HTML versions, both variants acceptable to HTML5 are shown here)
 
== Current Weather Conditions ==
 
<tr class="check<#currcond>">
<td>Current<br> weather:</td>
<td><#currcond></h2>
<td><small>(manually typed into Cumulus interface)</small></td>
}
and it is then instructed not to show the table row.
Conversely, if current weather has been input, the browser will look at each word and try to find a matching class, assuming it fails to match any, it will take the default action of displaying the table row. See [[httphttps://sandaysoftcumulus.com/forumhosiene.co.uk/viewtopic.php?f=14&t=9985&sid=f7ba680a73fbeccc0c18523515fac384| forum]] for more information.
 
== Rising/Falling ==
[[Webtags#Current_Conditions | <#temptrendenglish> and <#presstrendenglish>]] contain one of a few predefined values. They can be treated as boolean for a modification of say [[Customised_templates | indexT.htm]] because the HTML can testselect a different image for each of the pre-defined values (steady, falling, rising), suitable images for '''<#presstrendenglish>.gif''' are in the folder ''webfiles\dbimages'' and include '''Falling.gif'''. TheseThey arecould alreadybe used byto theselect javascriptdifferent associatedCSS withfiles theso standardgiving gaugesT.htm,the butwhole explainingweb scriptingpage isa outsidelook thethat scopevaries offor anthe articledifferent concentratingpredefined ontrend HTMLvalues.
 
The images mentioned are already used by the javascript associated with the standard gaugesT.htm, but explaining scripting is outside the scope of an article concentrating on HTML.
 
== Changing the whole web page ==