[Templates] Benefits of Modularity/Usability
Hann, Brian
Brian.Hann@umb.com
Wed, 27 Mar 2002 13:40:23 -0600
Leo,
I do plan on separating out the header, navbar and footer,
but the templates I'm talking about might differ by as little as
some HTML. For instance, you've probably used one or more of the
popular BBS's. The "post new topic" page will have a ton of
images, javascript, input types, etc. Then the "reply to topic"
page will be EXACTLY the same as the "post new topic" page except
some of the HTML and form stuff will be different and some
buttons will be named differently.
When you're only changing that small amount of an amount of
content, which is the better solution?
Thanks,
Brian
P.S. I'm using Outlook Exchange. I hope this message doesn't get
messed up but it probably will.
-----Original Message-----
From: Leo Lapworth [mailto:leo@cuckoo.org]
Sent: Wednesday, March 27, 2002 12:17 PM
To: Hann, Brian
Cc: templates@template-toolkit.org
Subject: Re: [Templates] Benefits of Modularity/Usability
Hi Brian,
On Wed, Mar 27, 2002 at 11:12:29AM -0600, Hann, Brian wrote:
> This is my second dilemma related to using TT in the open-source BBS I'm
> working on.
> We are aiming to create templates in such a way that the common user is
> easily able to change look and feel without having to muck around too much
in difficult
> TT syntax.
>
> The question I have is whether it is better to create separate templates
for
> each screen (
> even if similar templates only differ by a few lines), OR if it is better
to
> create one
> "over-template" for similar templates and then create external blocks for
> the parts that differ.
> You would just include a certain block depending on which template you
> wanted.
I often have:
<html>
...
[% INCLUDE includes/topbit.html %]
[% INCLUDE includes/nav.html %]
<P>
Page specific content and TT code.
</P>
[% INCLUDE includes/bottombit.html %]
</html>
In this way people who just want to do a little customization
only need to edit the topbit.html and bottombit.html standard html files but
if they want to alter the nav (or any other blocks you pull out)
then they can do. Then advanced users can edit the lot.
You could go as far as to create
includes/basic/
includes/general/
includes/advanced/
And then document it accordingly.
Just my 2c.
Leo