Re[2]: [PEAR] Smarty vs PEAR::HTML_Template_IT
| From: | Katana | Date: | Tue, 17 Dec 2002 14:30:31 +0000 |
| Subject: | Re[2]: [PEAR] Smarty vs PEAR::HTML_Template_IT | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3017@lists.php.net to get a copy of this message | ||
JH> Thanks for your input. If you want to use templates the designer (and the
JH> programmer ofcourse) HAS to learn something about some template system
JH> (obviously) . The way I work now, is that I let the designer create the HTML
JH> pages in whatever editor he/she likes and when my programming is almost
JH> finished I take the HTML pages and cut them up into headers, footers, menus
JH> etc and replace "dummy text" in the pages with variables or loop and echo
JH> statements that will be filled with real data (from a DB or whatever). This
JH> process doesn't take me too long and works, but it is of course far from
JH> ideal. Especially when the designer wants to change things and doesn't know
JH> how anything about loops and other PHP code. I allways have to assist the
JH> designer in changing the pages or worse - do it myself.
It's almost the way I work too. The only difference is that the HTML integrator
is someone else. So i just design "dummy" templates with the needed display
logic, and when the design is done, the integrator takes it and modifies the
templates.
JH> I'm more in favor of the "Smarty philosophy" I think, becuase I agree that
JH> there is such a thing as presentation logic and it is the designer's
JH> responsibilty to work with that. But this is unfortunately not always the
JH> case. And I'm also not quite sure how Editors like Dreamweaver will handle
JH> Smarty's {img} tags.
Afaik, there are - basically - no such tags. At least not that i know about.
Someone was a while ago talking about an {img} plugin he wrote, but I'm just
using classical <img> tags.
JH> You can't really tell a designer to start using a code editor, just because
JH> you want to use a template system, I mean, you don't want people telling you
JH> to use Notepad instead of your favorite IDE too. So all in all I still don't
JH> know if I should bother the designer (and myself) to learn how to use a
JH> template system, especially when it is as complex as Smarty is. Have you
JH> worked with designers and taught them how to use a template engine? What was
JH> your experience?
My experience is that I'm lucky enough to work with an integrator who knows PHP.
So he knows what a control structure is...
But I also had to work on a project with a guy who was not a programmer, and it
was quite easy to explain him basic Smarty structure.
In fact, I think that there is no perfect method. If you work with your HTML
without / around your PHP code, you can't ask the designer to integrate it, so
you have to do it yourself. If you work with a template engine, your designer
should be able to design a basic template, even if you have to make some changes
later on.
For this situation, something great with Smarty is that you can write
prefilters... so if you really want to make your templates WYSIWYG friendly, you
can write prefilters who will allow the usage of a XHTML compliant syntax during
the edition process.
By the way, why should we, developpers, change our habits so that the designers
do not have to change anything ? :)
JH> This should probably go to a different mailling list, but hey, the
JH> discussion started here ;-)
I don't think it's that a bad place. It's a general discussion about templates
implementation (in PHP), the PEAR ML sounds like place of choice to me :)
Katana