From: "Bill Moseley" <[email protected]> On Thu, Nov 26, 2009 at 2:07 PM, Octavian Râsnita <[email protected]>wrote:
> > HTML is a view. > Databases are for models. > > > I agree with this, and I also don't like it, but I couldn't find a better > way. > > I need to offer a way of creating/modifying the pages that present the > company, the services by web forms, and those pages contain many > paragraphs > of text, links, headings, lists and tables. > Templates are fine in the database. I think you want to PROCESS the template instead of eval, though. I use static templates, that also use a wrapper and in those templates I include things that should appear in (almost) all the pages, like a main heading, a [% PROCESS ... %] line that include another template when some conditions are met, and... the line that include the main body from the database. I have also set the page title, meta keywords and description before specifying the WRAPPER so they appear in the page html header using: [% title = page.title; description = page.description; keywords = page.keywords; WRAPPER wrapper.tt -%] (I don't define these variables in the same TT block after the WRAPPER because for some pages I need to translate them and I use a TT MACRO for doing this and it is not valid a code like: [% WRAPPER wrapper.tt title = l(page.title) %] So in these conditions, I don't know how I could PROCESS that part of the web page which is taken from the database. Anyway, it is pretty confusing because I still don't know which would be the best way of storing complex data that also include text, tables, links, lists, because it seems that storing them as html is not a good idea. I have just read a little about Text::Textile and I think it could be a useful format, however I am not sure for the moment. Octavian _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
