[cgiapp] Re: Template::Toolkit Plugins
On 2004-01-28, Stephen Howard [EMAIL PROTECTED] wrote: Now why I like TT is that i don't really have to do any 'display prep' of the items to be returned to the user. I appreciate this. I've wrestled with this some using H::T. Data::Grouper and careful use of DBI help this some, but I could still imagine a way for this to still be simpler and easier. And while the power is available to put application logic into the templates, no one is forcing you to do so. It's a bit like perl in that sense. It's _okay_ to use only a subset of the syntax available. You've been given miles of rope to hang yourself with, with the understanding that as a developer you're expected to introduce your own design constraints to your project, and not have the tools you use do it for you. TT has given me the freedom to do what i want, and I decide that i won't cross the line of putting app logic in my templates. I see. I can appreciate this philosophy as well. Is anyone aware of tuturials that focus on learning to use TT this way? That would seem useful in attracting other H::T users. I would appreciate the focus of such a document. Mark -- . . . . . . . . . . . . . . . . . . . . . . . . . . . Mark StosbergPrincipal Developer [EMAIL PROTECTED] Summersault, LLC 765-939-9301 ext 202 database driven websites . . . . . http://www.summersault.com/ . . . . . . . . - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] Re: Template::Toolkit Plugins (was: Re: CGI::App::DBH or Ima::DBI)
On Thu, Jan 29, 2004 at 06:43:48PM +, Mark Stosberg wrote: Header.tmpl: title[% Title %]/title !--Top navigation stuff here -- [% USE Family(PageID) %] [% FOREACH Relative = Family.Left_Rail %] [% IF Relative.Type == 'Parent' %] !-- Output a parent type breadcrumb -- [% ELSE %] !-- We also have 'Self', 'Sibling', 'Children', and 'Offlinks', but you get the idea -- [% END %] [% END %] Thanks for the concrete example, Brett. I think at some point it still comes down a preferred philosophy. Even the relatively simple syntax above is more than I want my designer to deal with. For sake of example, here's Brett's sample header.tmpl recoded in the Petal[1] format which I'm currently using (and, yes, advocating ;). div id=header title tal:content=TitleYour Title Here/title !--Top navigation stuff here -- div tal:repeat=Relative Family.Left_Rail p tal:if=eq: Relative.Type string:ParentParent Type Breadcrumb/p p tal:if=eq: Relative.Type string:ChildrenChildren Type Breadcrumb/p p tal:if=eq: Relative.Type string:SiblingSibling Type Breadcrumb/p /div /div This could be pulled into another template with the following line: xi:include href=header.tmpl / Hopefully these examples will begin to provide some material on which to build examples, test suites and benchmarks. William [1] http://search.cpan.org/~jhiver/Petal/ -- Knowmad Services Inc. http://www.knowmad.com - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] Re: Template::Toolkit Plugins
well, to be fair to TT, i think it's a little easier to read it this way, as opposed to the original example title[% Title %]/title [% USE Family(PageID) %] !--Top navigation stuff here -- [% FOREACH Relative = Family.Left_Rail; SWITCH Relative.Type; CASE 'Parent' %]Parent Type Breadcrumb[% CASE 'Children' %]Children Type Breadcrumb[% CASE 'Sibling' %]Sibling Type Breadcrumb[% END; END; %] Now I'm not saying that to an html-coder this is necessarily as transparent as the Petal example, but as your statement was very switch-like, i thought i should at least put forward an equivalent example. Petal does look interesting, and dare i say it even appeals to my personal sense of aesthetics from this one sample. I worry i'd have a hard time looking at it and picking out the template versus the code bits while editing one though. the [% %] default tag markers and UPPER case directives of TT help me (and my syntax hilighter) with that. William McKee wrote: On Thu, Jan 29, 2004 at 06:43:48PM +, Mark Stosberg wrote: Header.tmpl: title[% Title %]/title !--Top navigation stuff here -- [% USE Family(PageID) %] [% FOREACH Relative = Family.Left_Rail %] [% IF Relative.Type == 'Parent' %] !-- Output a parent type breadcrumb -- [% ELSE %] !-- We also have 'Self', 'Sibling', 'Children', and 'Offlinks', but you get the idea -- [% END %] [% END %] Thanks for the concrete example, Brett. I think at some point it still comes down a preferred philosophy. Even the relatively simple syntax above is more than I want my designer to deal with. For sake of example, here's Brett's sample header.tmpl recoded in the Petal[1] format which I'm currently using (and, yes, advocating ;). div id=header title tal:content=TitleYour Title Here/title !--Top navigation stuff here -- div tal:repeat=Relative Family.Left_Rail p tal:if=eq: Relative.Type string:ParentParent Type Breadcrumb/p p tal:if=eq: Relative.Type string:ChildrenChildren Type Breadcrumb/p p tal:if=eq: Relative.Type string:SiblingSibling Type Breadcrumb/p /div /div This could be pulled into another template with the following line: xi:include href=header.tmpl / Hopefully these examples will begin to provide some material on which to build examples, test suites and benchmarks. William [1] http://search.cpan.org/~jhiver/Petal/ - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] Re: Template::Toolkit Plugins
William McKee wrote: This could be pulled into another template with the following line: xi:include href=header.tmpl / I want to make a fundamental points about website design here... componentizing a website's view via a templating language is very different from what experts in Macromedia Dreamweaver or Frontpage are used to having done. Designers work on whole pages, using the reuse mechanisms of their design tool to control consistent look and feel. This is the primary reason that HTML::Seamstress lacks such tools --- after the HTML designer has mocked up whole pages, seamstress weaves dynamic content. But of course conditionals can be done with tree-based processing as well: http://www.urth.org/~metaperl/domains/metaperl.com/talks/2003/november/slide004.html - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] Re: Template::Toolkit Plugins
On Thu, Jan 29, 2004 at 06:00:58PM -0500, Terrence Brannon wrote: I want to make a fundamental points about website design here... componentizing a website's view via a templating language is very different from what experts in Macromedia Dreamweaver or Frontpage are used to having done. Valid point, however I don't think any of the templating languages discussed so far that have the ability to include/import external files (e.g., H::T, Petal, TT2) *require* componentizing. It's a feature that can be used/abused as needed. Regards, William -- Knowmad Services Inc. http://www.knowmad.com - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]