in reply to Re: How to Separate Presentation from Implementation with HTML::Template
in thread How to Seperate Presentation from Implementation with HTML::Template

For the most part I agree, however, I don't think the perl guts to the system are relavent to the medium or the message, and more importantly, The web side of things is to be maintained by someone else other than me, someone who, at best, knows of perl, so it'd be bad for him to need to dig into my code to alter a presentation element, I was hoping someone might have some ingenius idea of a way to allow the webmaster (that better than monkey for yah? :P ) to edit the template just as though it were any other page.

I wonder if perhaps another templating system would lead to my solution, I just went with the only one I could find that I could get on my home box that'd run w/ activeperl, so I could test before I messed around with something live.

Just Another Perl Alchemist
  • Comment on Re^2: How to Separate Presentation from Implementation with HTML::Template

Replies are listed 'Best First'.
Re^3: How to Separate Presentation from Implementation with HTML::Template
by arkturuz (Curate) on Jan 12, 2007 at 09:10 UTC
    I think that that 'someone' will have to learn the basics of your templating engine, if she is to maintain the web site without your further involvement as a web service programmer. If she is to be in control of things, then I suggest that you develop an API-like system: for every template define bunch of variables of the system, that the designer can work with. You write the docs about the meaning of each variable and present them to the designer. She is then able to change the presentation as she likes.
    I am in somewhat similar position; I am the web design maintainer and the programmer on the server side (I got finished design of our site). And I did just what I described: so if I want to change something I don't have to browse through server-side source, my template already 'knows' a lot.
    Also, if you plan some serious programming stuff on the template side, I suggest you try Template::Toolkit as HTML::Template is somewhat limited to simple expressions.

      Aye, that seems to be the case, it's just not possible with the basic HTML::Template, while I intend to be still be involved for a while, I see no reason he needs to either go digging in my code to change the appearance of the page or to have me do it. I will look a little deeper into Template::Toolkit, I've only took a cursory glance at it so far, I initially went with HTML::Template because of it's simplicity, and perhaps because it's templates look more like HTML, perhaps it would be best to switch to Template::Toolkit, for the very opposite reason, so it will be obvious what is straight up HTML, and what's code he'd be better off leaving be, since I'm apparently going to have to have SOME sort of code in the template to keep him from needing to get into the script itself. I'll see about doing as you've suggested and clearly delineating what variables need to be altered to affect what aspects of appearance. Though if anyone comes up with any miraculous methods to accomplish the seperation, I'm still open to ideas ;).

      I appreciate the advice, this is my first semi-serious project in which I need to consider the ability of people other than myself, and particularly nonprogrammers to maintain certain aspects. All previous projects have either been things I intend only for my own use/learning or to be used as is by nonprogrammers with no inclination to muck about with the internals.

      Just Another Perl Alchemist
        I initially went with HTML::Template because of it's simplicity, and perhaps because it's templates look more like HTML [...]
        You can tell TT to use other tags than "[% ... %]" by the way, although I personally prefer them as they are. Mainly because of my VIM highlights though :)

        Ordinary morality is for ordinary people. -- Aleister Crowley