> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Keith Jackson
> Sent: Tuesday, July 02, 2002 5:24 PM
> To: Will
> Cc: HTML Template
> Subject: Re: [htmltmpl] placing .tmpl files in a subdirectory?
>

Just to add my method :


>
> What we do is to place them in a directory at the same level as docroot
> and cgi-bin in a directory called templates.

We store them outside of 'cgi-bin' and in fact, outside of the server_root
altogether.

We use a five-level deep structure of directories to store our templates :
user's role templates, component (single-cgiapp), application
(group-of-cgiapp), overall system templates, overall component templates.
The bottom three levels ( role, component, application ) could contain a
very flexible interface for a single application.  The same application
could exist solely using the top two levels ( system, component .)

We also load all of our templates via an Abstract Factory pattern (
implemented as 'load_tmpl( )' in CGI::Application. ) This way the arguments
passed to 'HTML::Template->new( )' are consistent and we can generate a new
hierarchy from the configuration of the environment when a template is
requested.

Our structure is this way because we are deploying many copies of the same
component with different interfaces (HTML::Templates,) and thus, we need a
way to put custom HTML::Template files where needed but always be able to
reuse the templates that were not changed.  If a group of cgi::applications
all use a template with the same name / functionality (a function of
cgi::app design I guess) then a single template at application (group of
cgi::app) can update multiple cgi::app interfaces (assuming the cgi::app in
question did not further override the template.)

Overriding 'load_tmpl( )' for cgi::application and using that to create
html::template objects helped our design remain flexible MANY times.  Even
if I was not using CGI::application I would still strongly suggest an
Adapter function of some type to ensure that updating your method for
creating html::templates never becomes a chore.

Just our method,

Cory


>
> During development, we have a secondary docroot set up point to that
> directory so the designers can see the templates in a browswer.  When we
> go to production, the secondary docroot is dropped.
>
> We also duplicate the directory structure under the templates directory
> to match as closely as we can the directory structuce of the cgi-bin
> directory to make maintenance easier.  This doesn't always work out, but
> for the most part it does.
>
> We also place the name of the template in a comment at the top of each
> template so the template can be identified from a browser.  Otherwise we
> would have to trace back through perl code to know which template is
> being used. Again, it makes maintenace much easier.
>
> Hope this helps.
>
> Keith Jackson
>
> On Tue, 2002-07-02 at 15:39, Will wrote:
> > Greets Folks,
> >
> > Does anyone here place their .tmpl files in a special
> > directory assigned just for templates, like maybe:
> >
> > /cgi-bin/templates
> >
> > I was thinking of doing this for organizational
> > purposes, but I wasn't sure of what problems I might
> > run into, or what path I would have to use in the CGI
> > programs, etc...
> >
> > Any advice appreciated.
> >
> > Thanks,
> >
> > Will



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to