Webtags/Parameters (preserving history): Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
→‎Use of spaces: Now rewritten whole section, as decided to add examples
m (→‎Use of spaces: Rewrite of last paragraph)
m (→‎Use of spaces: Now rewritten whole section, as decided to add examples)
===Use of spaces===
 
There are multiple parameterssymbols for specifying dates and times, and you might want spaces to appear between symbols in that output format.
 
If weYou need to includeadd spaces,quotation then we havemarks to enclose the wholeoutput format specifier inif doublespaces quotationare marks epresent.g. <code><#tag_name format="x y z"></code>
 
A simple output format modifier, which only quotes valid time/date symbols but adds some spaces would have double quotes delimiting the specifier, the syntax is <code><#tag_name format="x y z"></code> and an example is '''<#TpressTH format="h:mm tt">'''.
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.
 
It becomes more complicated if we need to include other characters not to be interpreted by the date time parameter parser. Such literals are discussed fully in the [[#Including literals in format parameters]] sub-section later. Here it is just essential to say that if spaces and other literal text are wanted as well as valid date/time symbols, then both double and single quotes must be used, and the spaces must be within the single quotes. An example, that shows all the options that MX allows, with literals is '''<#TpressH format="\a't 'h:mm'&nbsp;' tt' <small>on 'd/M/yyyy' </small>'">'''.
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.
 
For now just rememberFinally, 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. This means the type of quotes (single or double) used outside the web tag, cannot be used within the web tag. The complicated sounding (but actually simple solution) is to avoid placing literals, and/or spaces, 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===
5,838

edits

Navigation menu