template flute
play

Template::Flute Jure Kodoman Informa Studio Hancock, NY, October - PowerPoint PPT Presentation

Template::Flute Jure Kodoman Informa Studio Hancock, NY, October 2013 1 | Internal use only Another templating engine? Seriously? 2 | Internal use only Why? Likes Leather Doesnt like learning about templating engines Uses Adobe


  1. Template::Flute Jure Kodžoman Informa Studio Hancock, NY, October 2013 1 | Internal use only

  2. Another templating engine? Seriously? 2 | Internal use only

  3. Why? Likes Leather Doesn‘t like learning about templating engines Uses Adobe Dreamweaver Our designer 3 | Internal use only

  4. templatize To genericize by means of templates. 4 | Internal use only

  5. Manager‘s idea of the process. Project Manager Designer Done Developer 5 | Internal use only

  6. HTML needs fixing All the time. 6 | Internal use only

  7. HTML needs fixing Do it yourself • Looks ugly. • You hate your life. • You hate HTML. 7 | Internal use only

  8. HTML needs fixing Send it back Do it yourself • Designer fixes „his“ • Looks ugly. version. • You hate your life. • He crashes your • You hate HTML. template. • You get the blame. 8 | Internal use only

  9. Get rid of weird syntax Use only HTML 9 | Internal use only

  10. Having special, weird tags inside HTML is well... wrong. 10 | Internal use only

  11. Template::Flute To the rescue. 11 | Internal use only

  12. HTML <div class="customer_name">Mr A Test</div> <div class="customer_email">someone@example.com</div> XML <value name="customer_name" /> <value name="email" field="customer_email" /> Perl $flute->set_values({ customer_name => 'Bob McTest', email => 'bob@example.com' }); print $flute->process; 12 | Internal use only

  13. So ... This Means ? • Send pure HTML back to designer. • He can open it in his favourite „editor“. • You simply put it back when he sends it. • No need to mess with HTML any more. 13 | Internal use only

  14. What about Lists? 14 | Internal use only

  15. HTML <select class="color"> <option value="example">Some Color</option> </select> XML Specification <value name="color" iterator="colors"/> PERL @colors = ({value => 'red', label => 'Red'}, {value => 'black', label => 'Black'}); $flute = Template::Flute->new( template => $html, specification => $spec, iterators => {colors => \@colors}, values => {color => 'black'} ); 15 | Internal use only

  16. What if I want something conditionally removed? XML Specification <container name=”specs” value=”hasspecs”> <value name="color" iterator="colors"/> <value name="size" iterator="sizes"/> </container> 16 | Internal use only

  17. Fun things to do with Template::Flute: ● Your designer can see results right in the dev. ● Allow customers to use their own templates. ● Easier to develop Apps ● Custom designs for customer's specific needs 17 | Internal use only

  18. Questions? 18 | Internal use only

Recommend


More recommend