Webtags as boolean operators in HTML: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
Text replacement - "http://sandaysoft.com/forum/" to "https://cumulus.hosiene.co.uk/"
m (Text replacement - "http://sandaysoft.com/forum/" to "https://cumulus.hosiene.co.uk/")
 
(3 intermediate revisions by one other user not shown)
Line 8: Line 8:
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.
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">
   <img src="bell_<#DataStopped>.png">
NOTE: Some versions of HTML would require slightly different syntax
NOTE: Some versions of HTML would require slightly different syntax (note space before slash)
   <img src="bell_<#DataStopped>.png" />
   <img src="bell_<#DataStopped>.png" />
but both will work in the latest HTML5.
but both will work in the latest HTML5.
== New extremes ==
== 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.
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_blue<#LowMaxTempRecordSet>.png" alt="O" />Lowest Daily Maximum</th>
   <th><img src="led_red<#HighTempRangeRecordSet>.png" alt="O" >Largest Daily Range</th>
   <th><img src="led_red<#HighTempRangeRecordSet>.png" alt="O" >Largest Daily Range</th>
(again inclusion/exclusion of the slash at the end of the img element varies between HTML versions, both variants acceptable to HTML5 are shown here)
(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 ==
== Current Weather Conditions ==
Line 31: Line 32:
  }
  }
and it is then instructed not to show the table row.
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 [[http://sandaysoft.com/forum/viewtopic.php?f=14&t=9985&sid=f7ba680a73fbeccc0c18523515fac384| forum]] for more information.
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 [[https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=9985&sid=f7ba680a73fbeccc0c18523515fac384| forum]] for more information.


== Rising/Falling ==
== 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 test 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'''.  These 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.
[[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 select 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'''.  They could be used to select different CSS files so giving the whole web page a look that varies for the different predefined trend values.
 
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 ==
== Changing the whole web page ==

Navigation menu