Webtags (preserving history): Difference between revisions

m
Line 13: Line 13:
These are special markers placed in a file which Cumulus can then process and replace with the actual values.  Typically you would use this to build your own website by having an HTML template file with your layout, static text and graphics.  In the position on the page you wish Cumulus to insert the relevant data place a webtag in the form:
These are special markers placed in a file which Cumulus can then process and replace with the actual values.  Typically you would use this to build your own website by having an HTML template file with your layout, static text and graphics.  In the position on the page you wish Cumulus to insert the relevant data place a webtag in the form:


  <pre><#tagname></pre>
  <pre><#tag_name [optional input parameters][optional output parameters]></pre>


''Note: When you put a tag into your template, be careful that whatever program you are using to develop your web pages doesn't change the angle brackets to slightly different symbols -- this is a common cause of failure!''
''Note: When you put a tag into your template, be careful that whatever program you are using to develop your web pages doesn't change the angle brackets to slightly different symbols -- this is a common cause of failure!''


Webtags are case sensitive, so please type them exactly as shown in the web tag columns on this page, or with parameter modifiers added as examples that are also shown on this page.
Web tags are case sensitive, so please type the tag name exactly as shown in the web tag columns on this page. These web tag markers can return values for both readings from your weather station and the what can be derived from those readings. A small number of web tags require lower case input parameters to select which value is shown (e.g. value for one hour ago). Although some web tags will not accept output parameters, others allow you to vary the number of decimal places that are output, or to vary the way that times and dates are output. Some output parameters are case sensitive for Cumulus 1 (all are case sensitive for MX), so do check them carefully.


=== Using web tags in templates for creating HTML pages ===
=== Using web tags in templates for creating HTML pages ===
Line 28: Line 28:
*You can also use the tags within script, this might be a PHP script, or JavaScript either embedded in HTML, or in external files, to transfer the values represented by the tags to the server for further processing.
*You can also use the tags within script, this might be a PHP script, or JavaScript either embedded in HTML, or in external files, to transfer the values represented by the tags to the server for further processing.
*As JavaScript can not understand a real number that has the integer and decimal parts separated by a comma, but your computer may be set to use that representation in standard tags, there are special versions of many tags to use in script - see [[#No_Commas|tags with commas removed]] section.
*As JavaScript can not understand a real number that has the integer and decimal parts separated by a comma, but your computer may be set to use that representation in standard tags, there are special versions of many tags to use in script - see [[#No_Commas|tags with commas removed]] section.
*Note that if a PHP or Javascript file contains any Cumulus web tags then you must [[Customised_templates#What_to_select_on_the_.27Files.27_tab_of_the_Internet_Settings_screen_within_the_.27Configuration.27_menu|ask Cumulus to process]] the script file.
*Note that if a PHP or JavaScript file contains any Cumulus web tags then you must [[Customised_templates#What_to_select_on_the_.27Files.27_tab_of_the_Internet_Settings_screen_within_the_.27Configuration.27_menu|ask Cumulus to process]] the script file.
*JavaScript processing code can be embedded in a template that is already being processed into HTML. (This technique has been used  in the standard 'monthlyrecordT.htm' template).
*JavaScript processing code can be embedded in a template that is already being processed into HTML. (This technique has been used  in the standard 'monthlyrecordT.htm' template).
*Alternatively embed a bit of JavaScript assignment code in HTML, that is already been processed, to convert the tags to a collection of string variables and use those variable names in any external script called from the HTML file. (This technique has been used in the standard 'gaugesT.htm' template).
*Alternatively embed a bit of JavaScript assignment code in HTML, that is already been processed, to convert the tags to a collection of string variables and use those variable names in any external script called from the HTML file. (This technique has been used in the standard 'gaugesT.htm' template).
Line 39: Line 39:


[[File:Badge vMx.png]]  Cumulus MX provides equivalent tags, with only minor differences (highlighted in tables below for latest build) that vary between builds. See tip at top of page for how to check which web tags are available in your build. Please see [[Cumulus_MX|page introducing Cumulus MX]] for more information regarding the tags missing from Steve Loft's original beta builds of MX. For [[BETA_webtags#Day.2FNight.2FSun.2FMoon|Moon web tags]], the key difference is adding parameters to control the output from build 3047.
[[File:Badge vMx.png]]  Cumulus MX provides equivalent tags, with only minor differences (highlighted in tables below for latest build) that vary between builds. See tip at top of page for how to check which web tags are available in your build. Please see [[Cumulus_MX|page introducing Cumulus MX]] for more information regarding the tags missing from Steve Loft's original beta builds of MX. For [[BETA_webtags#Day.2FNight.2FSun.2FMoon|Moon web tags]], the key difference is adding parameters to control the output from build 3047.
Please note that where this article makes reference to other pages in the Wiki, the information shown might be specific to Cumulus 1, as there are differences between the user interface for Cumulus 1 and MX flavours of this software,


=== Beta Builds of Cumulus ===
=== Beta Builds of Cumulus ===


There is a page that details the [[BETA webtags|additional webtags]] available in any Cumulus Beta version that is currently under development.
There is a page that details the [[BETA webtags|additional webtags]] available in any Cumulus Beta version that is currently under development. The same page is being used to show new web tag features as MX is being developed.


=Time/Date 'format' Parameter=
=Time/Date 'format' Parameter=
5,838

edits