[jifty-devel] Template::Declare defaults for Jifty

Jesse Vincent jesse at bestpractical.com
Fri May 11 11:47:26 EDT 2007


[Sorry for the delay. I've been sick and a little out of it]


On May 9, 2007, at 2:37 PM, David Brunton wrote:

> Hi nifty Jifty people,
>
> I have found that I really like Template::Declare.  Having used  
> Mason, Petal/TAL, HTML::Template, TT, and others in the past, I  
> found that Template::Declare was an immediate slam-dunk for my  
> visceral need to keep markup separate from logic.  Little did I  
> know that the answer lie in getting rid of markup entirely!  I've  
> never been so happy.
>

I'm glad to hear you like it :)

> I do have a question about it, though.
>
> The default wrapper template does some magic for me that I want to  
> keep.  But it also has one behavior I'd like to override (namely,  
> putting the salutation and navigation at the front of the HTML for  
> each page).  It turns out that simply putting 'private template  
> salutation => sub { };' makes the salutation disappear, and I can  
> do the same thing with menu.  But then I can't use "show  
> 'salutation'" later and have it display the salutation.

I'd Absolutely love, love, love to see the default page {} and  
wrapper {} better abstracted.

> What I would like to be able to do is either have both items left  
> out of the default wrapper template and included by default in a  
> View.pm generated at application setup time, or have them put into  
> a template of their own called "defaultheading," which I could then  
> "turn off" by the method described earlier.  I would still have  
> access to salutation and menu to display them wherever I like in my  
> HTML tree.
>
> I think the latter would be a relatively easy change- I would  
> replace this section:
>         div {
>             show 'salutation';
>             show 'menu';
>         };
> with
>
>         show 'defaultheading';

"defaultheading" seems to be a bad name here. It's not that we want  
to show the "defaultheading" template there, but that we want to show  
the heading(?) template there, which happens to have default content.

You've got a commitbit. By all means, go for it :)


> and create (for now) a Mason template called defaultheading that  
> wraps both of these in a single div.  That should replicate current  
> behavior for people who don't want to muck with it, and let me do  
> what I want.

A word of caution: cross-calling between various template libraries  
doesn't work yet. Starting on that would be great, too.

> I would also be willing to port the existing default Mason  
> templates to T::D when it's time for that to happen.

We did a lot of that, but I'm not intending to make mason go away  
entirely. I'd rather get cross-calling working right.


> Thoughts on that?  Other ideas?
>
> -db.
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20070511/952f69b7/PGP.pgp


More information about the jifty-devel mailing list