home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / comms_networking / zonk / rawdocs / wild < prev    next >
Encoding:
Text File  |  1999-02-13  |  2.0 KB  |  38 lines

  1. $zonkpage 1.07
  2.  
  3. $usetemplate: tpl.cmd/tpl
  4.  
  5. title: 'Wild dates'
  6.  
  7. text:{<sh>Flexible template selection</sh>
  8.  
  9. A template name, whether given as part of a configuration file $mapping or in a $usetemplate directive can contain a 'wild date' part embedded in it. This takes the form:
  10.  
  11. <lit>(<var>date format string</var>:<var>variable name</var>)</lit> 
  12.  
  13. (no whitespace is allowed in any of this)
  14.  
  15. the <var>date format string</var> will usually contain just a single <ref fstrin#date>date format element</r> (such as &w3 for three-character day name), though you are not actually restricted to this. The only restriction is that the resulting filename should be legal.
  16.  
  17. the <var>variable name</var> should be the name of a variable containing a valid date string. It may be defined in any of the system, global or user files (before the first $endpage, if any). If you want to use the current date then you should use %now. This is the only time that you should not use the <ref ctagv>'@' date treatas modifier</r> on the name with a date format, since Zonk will always try to interpret a variable's value in this context as a date.
  18.  
  19. The wild part may go anywhere within the template name specification, including the path, if you give one, but you are only allowed one wild part in the whole string.
  20.  
  21. If the resulting template name does not give an existing file then Zonk will try again with the wild part set to the empty string. This is so that if you want a different template for say Saturdays and Sundays but a single template for the rest of the week then you only need three templates and not seven. 
  22.  
  23.  
  24.  
  25.  
  26. <sh>Examples</sh>
  27.  
  28. given the variable 'docdate' with the value '11 Feb 1999' then a template name of <lit>main(&w3:docdate)tp</lit> would become <lit>mainThutp</lit> (as the 11th Feb is a Thursday).
  29.  
  30. A template specifcation of
  31.  
  32. <lit>ADFS::4.$.internet.site.templates.(&yr.&mn.:docdate)indexpage</lit> 
  33.  
  34. would give
  35.  
  36. <lit>ADFS::4.$.internet.site.templates.99.02.indexpage</lit> 
  37.  
  38. with the same value of 'docdate'