Use Perl to generate your skeleton? Nonesense. All i do is
create a "skeleton" that describes the layout. I usually
start by lifting a layout from
Box
Lessons. Then i either use HTML::Template or
Template. Here is a quick skeleton that i used
recently with Template-Toolkit:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:/
+/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="/css/default.css" type="text/css" />
<title>[% title %]</title>
</head>
<body>
<div id="top">
<h1>[% title %]</h1>
</div>
<div id="left">
[% PROCESS widget/menu.html %]
</div>
<div id="middle">
[% content -%]
</div>
<div id="right">
[% PROCESS widget/calendar.html %]
</div>
<div id="bottom">
[% PROCESS widget/footer.html %]
</div>
</body>
</html>
As you can see, the CSS file is completely seperate and not
generated by Perl! Instead, Perl is used
to load this template and substitute, etc. This is, IMHO,
a much better solution as it allows me to hand my HTML to
someone who designs and doesn't code.
So, in conclusion, my experience has been that the more
flexible and useful applications of Perl and CSS are to
simply template the skeleton and let Perl worry about the
data, not the presentation. Otherwise you might as well be
using Tk.
| [reply] [Watch: Dir/Any] [d/l] |
I kneel in reverence to the (very prestigious) saint whom honoured my humble node.
Yes, it was one of the replies I was expecting. I'm fully aware of the full potential of templating with HTML::Template,TT, Embperl and like...
Nonsense?? Maybe...
Honestly, I hate mark up. Of course I use it as others do. But I'm trying to avoid being friends with it. Of course there are modules and plugins that minimize the mark up usage in templating tools.
I just love extreme integration. (Even in math!! hehehe)I think I'm writing my own templating system in which there is no mark up but OO integration of CGI, and DBI, and CSS, and hey even dynamic SWF generation via (ming)Perl.
My purpose is to integrate PRESENTATION+ DATA. And if exists, may GOD spare us from Tk...
I might have not expressed my intention properly, besides it wasn't the point in the first place; the fact is, I'm not creating a skeleton with CSS layout. Maybe for I am a physicist, I'd like to think everything in matrices. As a skeleton analogy suggests, skeleton itself, holds the body together, upright... In this case, it is my matrix that holds everything, and layout is just one of the things it holds... The skeleton is the MATRIX! Each matrix element describes a unique DIV, and inside the matrix element
we have many many other references related to presentation and data, living happily together...
When I finish what I am trying to, I'll show it!!
| [reply] [Watch: Dir/Any] |
I see more of where you are going with this now. While i
still see it as potential overkill, i can still where it might be useful. I'd like to see what you come up with. I
am still a bit suspicious about using this for clients who
really want more flash than substance, but for those of us
who care more about the data, this could be useful.
| [reply] [Watch: Dir/Any] |
Jeffa,
Are you aware of any problem doing exactly as above with mod_perl. I can't seem to get the CSS to load.
avron
| [reply] [Watch: Dir/Any] |
was a configuration issue, now resolved !
| [reply] [Watch: Dir/Any] |
I'm working on LAYOUTs. I want to write a class that manages complicated layout creation. I will define the layout as a matrix, and each element in the matrix will specify a "box" in the web page, and carry specific (CSS and more)information about that box.
Work the problem backwards. Get your layout working with static HTML, then either
- Templatize the HTML using HTML::Template or Template::Toolkit, or
- Break the HTML up into pieces and get Perl to print them somehow.
Note that this is completely independent of CSS.
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |
It's part of a network of perl modules as I described in my bio. For some reason, I'd like use structs in my layout module(s). I think that's why I'm taking the implementation slow. I have to think what I should include in each matrix element. it'll be finished in a few days I hope!
| [reply] [Watch: Dir/Any] |