Webtags (preserving history): Difference between revisions

m
→‎Webtags available in Cumulus: add few tips for use in scripts
m (→‎Webtags available in Cumulus: add few tips for use in scripts)
Line 4: Line 4:
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:


  <#tagname>
  <pre><#tagname></pre>


Assuming you have asked Cumulus to process the file, it will replace the tag with the current value of the item the tag represents just before the file is uploaded to the internet.
''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 HTML, 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.


Webtags are case sensitive, so please type them as shown here.
=== Using web tags in templates for creating HTML pages ===
*You can create a template file that has a structure of HTML elements with Cumulus web tags to represent the information you want included.
*If you  [[Customised_templates#What_to_select_on_the_.27Files.27_tab_of_the_Internet_Settings_screen_within_the_.27Configuration.27_menu|ask Cumulus to process]] that template file, it will create a HTML page from the template, and during that file creation replace the tag with the current value of the item the tag represents.
*You also need to tell Cumulus that the resulting HTML file is to be uploaded to the internet (or copied to a local web server).


You can also use the tags within script files, but as JavaScript can not understand a real number that has the integer and decimal parts separated by a comma, there are special versions of many tags to use in script - see [[#No_Commas]] section.
=== Using web tags in scripts ===
*You can also use the tags within script, 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.
*Note that if a script 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.
*The whole script 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 script 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).
*Finally, remember that to use the value from a tag as an integer you need to use a
<pre>integer_variable_name=parseInt(string_variable_name,10)</pre> type conversion (or apply '*1', i.e. multiply by one, to implicitly convert the tag from string to base 10 number).


=== New Webtags in Beta builds ===
=== New Webtags in Beta builds ===
The web tags listed below are those available in the latest official (finalised version) release of Cumulus.


New webtags for beta versions of Cumulus are not listed here until the version becomes 'live' however there is a page that details the [[BETA webtags|additional webtags]] available in the Beta version.
New webtags for beta builds of Cumulus are not listed here until the version becomes 'live', however there is a page that details the [[BETA webtags|additional webtags]] available in any Beta version that is currently under development.


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

edits