From: shane <sh...@lo...> - 2001-05-14 11:21:58
|
At 10:20 PM 5/13/2001 +0200, you wrote: >Hi, > >I dont know if this has come up before, >Are there any plans to move using CSS?. > >If, yes, Ill be glad to help. >cheers Here's how I did it. I'm not sure I did it in the best method, it's a work in progress: 1. Changed html-header by adding this: <link rel="STYLESHEET" type="text/css" href="[% dir %]/[% section %]default.css"> So far, so good. I'm not sure whether or not I need a 2nd "/" after section to guarantee the file is included correctly. And, because of the way Slash.pm's header sub works, it only calls html-header if $title was passed to it. So, I think, if a page doesn't have a title then the stylesheet may not be included. 2. I dumped all the templates, and search/replaced for specific things that I wanted css to replace. YMMV. When I first tried messing with stylesheets under slash, I put the stylesheet into a template, and included that template. That was easier to manage then the above (for which you would need shell access to edit the file) *but* the idea of the sytle sheet is that you download that one file and the browser can reference it over and over. With it in a template the browser is downloading it each hit. That seems too wasteful to me so I put it into a file. I thought about keeping it in a template, but dumping it to a file routinely with portald-site. I also thought about modifying Slash.pm's header sub and putting in something like if ($constants->{show_css}) { $css = getCSS(1); } and then modify the header template such that it looks like this: __section__ default __description__ Text that makes up the top of a page No specially passed variables __title__ __page__ misc __lang__ en_US __name__ header __template__ [% IF constants.show_css %] [% INCLUDE csscode %] [% END %] </HEAD> <BODY> etc etc etc.... I too would appreciate any suggestions you might have as to the best way to implement this. Thanks, Shane |