Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: CSS and perl

by jeffa (Bishop)
on Sep 30, 2003 at 13:17 UTC ( [id://295274]=note: print w/replies, xml ) Need Help??


in reply to CSS and perl

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.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: Re: CSS and perl
by bakunin (Scribe) on Sep 30, 2003 at 16:05 UTC
    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!!
      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.

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)
      
Re^2: CSS and perl
by avrono (Novice) on Apr 27, 2009 at 18:19 UTC
    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
      was a configuration issue, now resolved !

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://295274]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-24 18:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found