html templating advice.

Discussion in 'Perl' started by lloyd christopher, Oct 22, 2003.

  1. im developing a template based web application in perl and need some
    guidance. currently its all pretty simple stuff, we tell the designers
    place holders to use and then &username; or %USERNAME% or <MYusername/>
    would be replaced by the value. basically what the perl cookbook uses in a
    few examples iirc.

    however more and more we have to deal with more complex data. variable
    length lists of data. say for example a list of new products per day, one
    day might have 4, one might have 7. so far we tell them to put %TABLE% and
    it gets replaced with a preformatted table with lots of id's and classes so
    they can customize the look of it.

    what i really would like to do though is give them more power. something
    along the lines of:

    <table>
    <mytable>
    <tr><td>&product;</td><td>&description;</td></tr>
    </mytable>
    </table>

    and then i can loop through the <mytable>..</mytable> for each one. i can
    do this easily enough using regular expressions, but what i'd like to know
    is if there are any standards for this sort of thing that already exist, any
    modules etc. obviously i'd rather not reinvent the wheel. HTML::parser?
    DOM?

    (yes i know i keep jumping between styles of placeholders, trying to decide
    on whats the best / standard if their is one).

    thanks alot sorry for the rambling post.

    lloyd christopher
    SLOW30
     
    lloyd christopher, Oct 22, 2003
    #1
    1. Advertising

  2. lloyd christopher wrote:

    > im developing a template based web application in perl and need some
    > guidance. currently its all pretty simple stuff, we tell the designers
    > place holders to use and then &username; or %USERNAME% or <MYusername/>
    > would be replaced by the value. basically what the perl cookbook uses in
    > a few examples iirc.


    There are a half-bazillion templating systems on CPAN already. If you
    find that they don't fit the bill, then look at them to get ideas of
    how you may like to proceed, and build on top of them. While I use
    HTML::Template for my HTML templating needs, I have other templating
    needs that even Text::Template doesn't fit.
     
    Darin McBride, Oct 22, 2003
    #2
    1. Advertising

  3. ya thats what i'm looking for is some recommendations on the good, the bad,
    and the appropriate. As you said, there are a half-bazillion and would take
    a while to go through them all..

    "Darin McBride" <> wrote in message
    news:A4Blb.150214$pl3.6745@pd7tw3no...
    > lloyd christopher wrote:
    >
    > > im developing a template based web application in perl and need some
    > > guidance. currently its all pretty simple stuff, we tell the designers
    > > place holders to use and then &username; or %USERNAME% or <MYusername/>
    > > would be replaced by the value. basically what the perl cookbook uses

    in
    > > a few examples iirc.

    >
    > There are a half-bazillion templating systems on CPAN already. If you
    > find that they don't fit the bill, then look at them to get ideas of
    > how you may like to proceed, and build on top of them. While I use
    > HTML::Template for my HTML templating needs, I have other templating
    > needs that even Text::Template doesn't fit.
     
    lloyd christopher, Oct 22, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David

    Advice Needed - Templating

    David, Jul 28, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    317
    David
    Jul 28, 2004
  2. Replies:
    9
    Views:
    380
  3. Ian Ward
    Replies:
    1
    Views:
    313
    Jarek Zgoda
    Aug 30, 2006
  4. Ian Ward
    Replies:
    0
    Views:
    278
    Ian Ward
    Sep 25, 2006
  5. Ruby Baby
    Replies:
    6
    Views:
    142
    Dan Janowski
    Jan 24, 2004
Loading...

Share This Page