Re: [Rest2web-develop] Multiple templates, same content
Brought to you by:
mjfoord
From: Fuzzyman <fuz...@vo...> - 2006-02-23 13:44:19
|
Peter Brett wrote: > On Thursday 23 February 2006 11:13, Fuzzyman wrote: > > >> Alternatively the *template* could probably already check the command >> line arguments. This would break if I added any other command line >> arguments. At the moment the first argument is always the config file, >> but no other command line options are used. >> >> > > What about having a special argument, e.g. '--' after which all remaining > arguments are passed to the template? Either that or a > '--template-args=<string>'... > We have to decide whether the best thing is to pass an option to specify a different file for the template or a value that the template can use to decide what to do. The disadvantage of the second is that you end up with conditional code inside your template, and possibly having to duplicate your html, all inside '<# ... #>' tags. Alternatively you could in your main 'template.txt', just load another file I suppose. The disadvantage of the first is that it means specifying a global value for something that can be set on individual files. Not necessarily a disadvantage - just not so orthogonal. How about : '--template-file=<path>' ? Would be easy enough to implement, and can be overridden for individual files or directories in the restindex. I still intend to implement global values in the config file - so it would be possible to customize that way *anyway*. Maybe a way of passing in uservalues via the command line would be a good thing to implement at the same time. That way you can implement whatever run-time 'switches' you want in templates or content. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Peter > > |