|
From: Chris W. <ch...@cw...> - 2002-08-30 03:38:34
|
On Thu, 2002-08-29 at 13:06, Nick Sutterer wrote:
> I'm currently writing a little package to deliver cascading stylesheets
> according to the theme in use. I noticed that OI has different "display
> modes", like main or simple. Until now these two modes are hardcoded in
> OI::UI::Main and the respective entries in server.ini below
> [template_names] aren't read in, as a comment states.
Right. You can also set the template name manually with:
$R->{page}{_template_name_} = 'foo::bar';
It would be easy to create a central method that set this as necessary.
> Question: I think of using these "modes" to present different
> versions of *one* theme, like print- or wap-version... is this the way I
> should do it?
I don't think so. It's too complicated. (Make a note of the date: I
rarely say this :-) Why not just have a single theme (e.g., 'main') and
inherit from it for as many different types you need (e.g.', 'main_wap',
'main_print', etc.). Then you'd only have to override the items you need
for the different themes.
> If this is the right way, it would be cool to have more than 2 modes
> (Reading the comments in the source I think Chris is already working on
> that...). Another idea is to have more attributes for one mode - not only
> the pseudo name of the main template, but also stuff like the
> stylesheet to use etc. What do you think?
You should be able to do this now. Just add a key 'stylesheet_name' to
the main template and embed it in the 'main' template:
[%- theme = OI.theme_properties -%]
<html>
<head>
<link rel="stylesheet" type="text/css"
href="[% theme.stylesheet_name %]" >
...
(I'm not sure if that's the right way to grab an external stylesheet,
but you get the idea.)
Is that the sort of thing you were looking for?
> Something else: I can't figure out how to return a static page from the
> website html directory in a content handler. Help!!
Every static page needs a matching entry in the database. You can do
this using a scanner to pick up all non-existing pages: Click 'Page
actions' in the 'Admin Tools' box, then 'Scan' and enter the directory
you want to scan. This makes it easy to FTP a bunch of files to a
directory then scan it and have them all automatically added.
Later,
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|