[Templates] Benefits of Modularity/Usability

Leo Lapworth Leo Lapworth <leo@cuckoo.org>
Wed, 27 Mar 2002 18:16:39 +0000


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