Webtags/Parameters (preserving history): Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
→‎Use of spaces: Rewrite of last paragraph
m (→‎Including literals in format parameters: update reference to previous mention)
m (→‎Use of spaces: Rewrite of last paragraph)
Line 210: Line 210:
If we need to include spaces, then we have to enclose the whole specifier in double quotation marks e.g. <code><#tag_name format="x y z"></code>
If we need to include spaces, then we have to enclose the whole specifier in double quotation marks e.g. <code><#tag_name format="x y z"></code>


Any literals (i.e. characters we do not want to be interpreted by the date time parameter parser) are generally enclosed in single quotation marks, within the double quotation marks delimiting the specifier.   
Any literals (i.e. characters we do not want to be interpreted by the date time parameter parser) are generally enclosed in single quotation marks, within the double quotation marks delimiting the specifier.  You will find literals discussed fully at [[#Including literals in format parameters]] later.


This can cause you a problem if you want to use a date/time specification in a script because the script wants literal delimiters round the entire web tag, so that delimiters remain when the web tag itself has been processed into a string by Cumulus.  The complicated sounding (but actually simple solution) is to avoid placing literals within any output format specifier, but instead put the literals outside with separate web tags before and after each literal. Then you can use single quotes outside.  This is employed in some of the scripts at
For now just remember, the use of literals can cause you a problem if you want to use a date/time specification in a script because the script wants literal delimiters outside any web tags, so that delimiters remain when the web tag itself has been processed into a string by Cumulus.  The complicated sounding (but actually simple solution) is to avoid placing literals within any output format specifier, instead put single quotes round the whole content. What you thought of putting as literals within any web tag is instead typed outside with separate web tags for the part of the specification before and after each literal.


===Which tag names take date/time output formatting modifiers===
===Which tag names take date/time output formatting modifiers===
5,838

edits

Navigation menu