Justin W | 12 Oct 19:43

Mdifiers to create attributes and custom field types?


I'm wondering if either of two things are possible in Petal.

1) A modifier that can create a series of element attributes.  Ideally,
something like:

<tag tal:attributes='modifier --${some/hashref}' />

Wherein modifier would return a data structure/string/something that would
allow it to make lots of attributes on tag.

And,

2) Is it possible to write a modifier that can inject a tag type?  I don't even
know how I would write this to give an example, but I'd like to be able to
dynamically generate the tag name itself based on output from a subtourine/data
structure/whatever.

Sometimes I'll want a <div, sometimes, I'll want a <span, sometimes, I might
want a <ul, who knows.

Thanks,
Justin

William McKee | 13 Oct 19:46
Favicon

Re: Mdifiers to create attributes and custom field types?

Sorry about all the emails. I'm having technical difficulties with my 
SMTP server. This is the full message which will hopefully go out this 
time! - WLM
----------------------------------------------------------
Hi Justin,

It's been a long time since I've seen traffic on this list. As much as I 
love Petal, it just hasn't been successful in winning over mindshare 
from other toolkits for the projects we're using (e.g., WebGUI). At any 
rate, I think that both of your questions are possible. I'd suggest you 
take a look at the Petal::Utils package[1] which contains a bunch of 
modifiers which you can learn from. Besides the POD, there are also 
tests which show how these are used. Let us know how it works out!

Good luck,
William

[1] http://search.cpan.org/~wmckee/Petal-Utils-0.06/

--

-- 
Knowmad Technologies
Smart Web Solutions - maximizing business results with Web technology
W: http://www.knowmad.com | E: william@... | P: 704.343.9330

William McKee | 13 Oct 19:45
Favicon

Re: Mdifiers to create attributes and custom field types?

Hi Justin,

It's been a long time since I've seen traffic on this list. As much as I 
love Petal, it just hasn't been successful in winning over mindshare 
from other toolkits for the projects we're using (e.g., WebGUI). At any 
rate, I'
>
> I'm wondering if either of two things are possible in Petal.
>
> 1) A modifier that can create a series of element attributes.  Ideally,
> something like:
>
> <tag tal:attributes='modifier --${some/hashref}' />
>
> Wherein modifier would return a data structure/string/something that 
> would
> allow it to make lots of attributes on tag.
>
> And,
>
> 2) Is it possible to write a modifier that can inject a tag type?  I 
> don't even
> know how I would write this to give an example, but I'd like to be 
> able to
> dynamically generate the tag name itself based on output from a 
> subtourine/data
> structure/whatever.
>
> Sometimes I'll want a <div, sometimes, I'll want a <span, sometimes, I 
> might
(Continue reading)


Gmane