473,378 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

html templating advice.

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
Jul 19 '05 #1
2 1557
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.
Jul 19 '05 #2
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" <dm******@naboo.to.org.no.spam.for.me> 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.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Dave Smithz | last post by:
Hi, Summary: Best way to divide out the HTML and PHP in some code I inherited. How can I keep the HTML files separate? Full Details: I've now been working two weeks on PHP / MySQL code I...
11
by: Gobo Borz | last post by:
Hi everyone, I have a python cgi program that uses print statements to write html. The program has grown, and for reasons I won't bore you with, I need to build the page in a string and "print"...
0
by: Carlos Ribeiro | last post by:
Hello all, While studying some of the templating systems available for Python, I've come up with an idea to implement templates using decorators. The following code snippet runs in Python 2.3; a...
13
by: Michele Simionato | last post by:
What is the recommended way of generating HTML from Python? I know of HTMLGen and of few recipes in the Cookbook, but is there something which is more or less standard? Also, are there plans to...
1
by: C. Olive | last post by:
Environment: Classic ASP running on IIS v5.1 Scripting Language: VBScript I suppose someone would have to be somewhat familiar with Perl in order to answer this question specifically. If you...
8
by: John M. Gabriele | last post by:
I'm putting together a small site using Python and cgi. (I'm pretty new to this, but I've worked a little with JSP/servlets/Java before.) Almost all pages on the site will share some common...
18
by: pkassianidis | last post by:
Hello everybody, I am in the process of writing my very first web application in Python, and I need a way to generate dynamic HTML pages with data from a database. I have to say I am...
10
by: Sullivan WxPyQtKinter | last post by:
Hi, everyone. Simply put, what I need most now is a python lib to generate simple HTML. I am now using XML to store my lab report records. I found python really convinient to manipulate XML, so...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.