Re: [Phplib-users] template extensions
Brought to you by:
nhruby,
richardarcher
From: Aric C. <gre...@pe...> - 2003-01-14 18:41:46
|
> At 06:59 PM 1/13/2003 -0800, Aric Caley wrote: > >It seems to go against the general idea of templates: to separate code from > >presentation. > > It seems that way to me, too. > > >It would also be nice for the templates to be able to use this to tell the > >code what to do in certain cases. For instance, what if the template has a > >4 by n grid. But the designer wants it changed to, say 6 wide. Currently > >you'd probably have a nested set of blocks (one for horizontal, one for > >vertical) and the code would determine how many wide to go, so the > >programmer would have to go in and change that. With this you could just > >have something like this: > > > >{setmatrix(4)} > ><!-- BEGIN matrix --> > ><img src="block.gif"> > ><!-- END matrix --> > > > >And the code would know what to do. > > ... or, you could code that as a variable in a configuration file or the > header section of your PHP file that fills in the template. Then, the PHP > file could determine what to do with that information. Strangely enough, > I've done exactly that with some of the stuff I have developed. > > For example, an image gallery thumbnail page has a configuration file that > has variables like thumbs_num_rows and thumbs_num_columns. The designer > can choose the numbers after the equal signs without even as much brain > power as required to understand the {setmatrix(4)} syntax. You can even > put a more detailed comment right before the settings for the unusually > obtuse designer. The PHP code then iterates appropriately when filling in > the template. It works great. And that's what I currently do. The more interesting aspect of this idea is that the designer could not only create the cosmetics but could more easily rearrange the whole structure of the site through the template, where normaly this would require moving around blocks of code. Then again, this could be achieved with the current template system and just using more clever code. > > Andrew Crawford > An...@Ev... > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: FREE SSL Guide from Thawte > are you planning your Web Server Security? Click here to get a FREE > Thawte SSL guide and find the answers to all your SSL security issues. > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > |