[uf-rest] Microtemplates

Dan Kubb dan.kubb at autopilotmarketing.com
Mon May 15 13:52:54 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Stephen,

> I've been working on something lately I call "microtemplates" that  
> might
> be of interest to folks on this list.

I think this is a really cool idea.  I can see some definite uses  
with AJAX
enabled applications.

What would be nice is if it did what you suggest, but it also had  
some knowledge
of how to pre-fill HTML forms.  So given a data structure like:

{vcard:{fn:"John Doe",url:"http://example.com"},adr:{streetAddress:  
"123 Main Street"}}}

And a template like this:

<fieldset class="vcard">
   <div>
     <label for="contact_name">Full Name</label>
     <input type="text" class="fn" id="contact_name" name="contact 
[name]" />
   </div>
   <div>
     <label for="contact_url">URL</label>
     <input type="text" class="url" id="contact_url" name="contact 
[url]" />
   </div>
   <div class="adr">
     <label for="contact_street_address">Street Address</label>
     <textarea class="streetAddress" id="contact_street_address"  
name="contact[street_address]"></textarea>
   </div>
</fieldset>

It could fill things in to make it look like this:

<fieldset class="vcard">
   <div>
     <label for="contact_name">Full Name</label>
     <input type="text" class="fn" id="contact_name" name="contact 
[name]" value="John Doe" />
   </div>
   <div>
     <label for="contact_url">URL</label>
     <input type="text" class="url" id="contact_url" name="contact 
[url]" value="http://example.com" />
   </div>
   <div class="adr">
     <label for="contact_street_address">Street Address</label>
     <textarea class="streetAddress" id="contact_street_address"  
name="contact[street_address]">123 Main Street</textarea>
   </div>
</fieldset>

- --

Thanks,

Dan
__________________________________________________________________

Dan Kubb
Autopilot Marketing Inc.

Email: dan.kubb at autopilotmarketing.com
Phone: 1 (604) 820-0212
Web:   http://autopilotmarketing.com/
vCard: http://autopilotmarketing.com/~dan.kubb/vcard
__________________________________________________________________



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (Darwin)

iD8DBQFEaOom4DfZD7OEWk0RAnpNAKCqgI1dltxnWEt4MYSCu9O6nEbcmgCfQYXo
JanK4BTaZd9/BxkD2k3wHsA=
=33Kv
-----END PGP SIGNATURE-----


More information about the microformats-rest mailing list