Re: [Phplib-users] Template reverse transformation
Brought to you by:
nhruby,
richardarcher
From: nathan r. h. <na...@ds...> - 2003-05-07 14:07:31
|
On Tue, 6 May 2003, Tim Macinta wrote: > > I consider ease of use by designers to be extremely important in a > templating system. Ideally, this would mean that there is seamless > WYSIWYG support so that designers who use things like Dreamweaver can > edit a *single* HTML file with *real* data on it and have the changes > reflected in the templates that were used to build that page. I know > there is a temptation to ask what's so hard about editing Template1, > Template2, etc by hand, but for designers that only know Dreamweaver and > don't know HTML, it's a moot point - regardless of how hard it is, it's > not an option in a lot of cases. > Coddling lazy, stupid or incompetent designers doesn't make them better and only makes matters worse. That said, I'm all for making things simple for everyone and not making people have to jump through hoops just to get their job done. There is a fine line though, and it requires both side to give a little. If your designers can't use HTML fragments at all, then they need to try just a little bit harder at what they do, or you need to try a little bit harder at teaching them what they need to know in order to be comfortable. I personally think you're trying to bend over backwards for something that really isn't worth the time, energy or effort. Additional personal rant: Dreamweaver blows big fat chunks and lowers the IQ of it's users by 10 points every time they upgrade :-P > > Below is how this could be achieved in a system that would be > implemented from scratch. The basic gist is that you can put the > templating system in "debug" mode, which would then result in pages > being generated with <span> tags wrapping template fragments and > variables so as to identify them later. The designer would edit the > single, exported page (which contains real data instead of variable > names) in a WYSWIG editor and then upload the modified page to the > template system. The template system would then use the <span> tags to > figure out which templates created which pieces of the page and then > modify those templates accordingly. > Why? You're not talking about breaking apart a single file into discrete templates, you're talking about taking discreet templates, gluing them into a valid page, editing them, and then taking them apart again. Different things, which is a subtle difference. If you have discrete teplates already in a phplib tempalte system, just add comment lines at the top and bottom of each template 'nugget' indicating what it is, then in post processing, jsut rip the edited page back into components with miltiline regexps and process those. You can do that outside the phplib templating engine. > That's the Reader's Digest summary - see below for *much* more detail. > My question again is whether something similar could be built into > PHPLIB and what this would take? I know this would be extremely > difficult to make work correctly with probably the majority of PHPLIB's > features, but I'd still be happy even if getting a reverse > transformation feature necessitated that I use a certain sub-set of > PHPLIB features in my templates. > phplib's tempalte.inc does not meet most of the needs you cite, nor do I think it should out of the box. It's goal is to do one thing well and fast, which it does. If you need additional features it's up to you to implement them for your own specific needs using tempalte.inc as a reference or as the core for your projects. [snip thesis] -n -- ------ nathan hruby na...@ds... ------ |