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

template flute
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

1 | Internal use only

Template::Flute

Jure Kodžoman

Informa Studio Hancock, NY, October 2013

slide-2
SLIDE 2

2 | Internal use only

Another templating engine?

Seriously?

slide-3
SLIDE 3

3 | Internal use only

Why?

Our designer Uses Adobe Dreamweaver Likes Leather Doesn‘t like learning about templating engines

slide-4
SLIDE 4

4 | Internal use only

templatize To genericize by means of templates.

slide-5
SLIDE 5

5 | Internal use only

Manager‘s idea of the process.

Project Manager Designer Developer

Done

slide-6
SLIDE 6

6 | Internal use only

HTML needs fixing

All the time.

slide-7
SLIDE 7

7 | Internal use only

HTML needs fixing

Do it yourself

  • Looks ugly.
  • You hate your life.
  • You hate HTML.
slide-8
SLIDE 8

8 | Internal use only

HTML needs fixing

Send it back

  • Designer fixes „his“

version.

  • He crashes your

template.

  • You get the blame.

Do it yourself

  • Looks ugly.
  • You hate your life.
  • You hate HTML.
slide-9
SLIDE 9

9 | Internal use only

Get rid of weird syntax Use only HTML

slide-10
SLIDE 10

10 | Internal use only

Having special, weird tags inside HTML is well... wrong.

slide-11
SLIDE 11

11 | Internal use only

Template::Flute

To the rescue.

slide-12
SLIDE 12

12 | Internal use only

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;

slide-13
SLIDE 13

13 | Internal use only

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.
slide-14
SLIDE 14

14 | Internal use only

What about

Lists?

slide-15
SLIDE 15

15 | Internal use only

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'} );

slide-16
SLIDE 16

16 | Internal use only

What if I want something conditionally removed?

<container name=”specs” value=”hasspecs”> <value name="color" iterator="colors"/> <value name="size" iterator="sizes"/> </container>

XML Specification

slide-17
SLIDE 17

17 | Internal use only

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
slide-18
SLIDE 18

18 | Internal use only

Questions?