[albatross-users] Two questions (client-side production of static pages)

Tim Churches tchur at optushome.com.au
Fri Jun 28 05:19:19 EST 2002


Andy Gimblett wrote:
> I'm (currently) only using Albatross on the client-side.
> Specifically, I'm using its templating capabilities to build static
> pages which then get uploaded to my ISP's web server.  There are a
> couple of things I've had problems with.  I've fixed one (sort of),
> but the other leaves me stumped.
> 
> The first question/point: I want to be able to produce output to a
> file, not just stdout (don't want to use redirection as using stdout
> for other purposes).  Now, I've achieved this by patching ExecuteMixin
> and SimpleContext in the following "quick and dirty" manner:
....8<....
> This works for me, but I was wondering:
> 
>   - Can anyone think of a better way to achieve this?
> 
>   - Is this (or a better solution) something that could be folded into
>     the offical distribution, so I needn't maintain my own fork?  :-)
>     It seems a useful capability to me.

I second the request for static page generation capabilities. I think I
might
have briefly discussed this with Dave and Andrew at some stage. In our
application(s)
[currently one, soon to be more], after specifying a set of parameters,
various
epidemiological analyses are run and a static results page is written to
disc 
on the httpd server, and the user's browser is redirected to that page
(which
contains generated graphs and tables, and in the future
machine-generated text).
Users often want to refer back to the results of previous analyses, or
to download
the entire page and host them elsewhere, so it makes sense to keep the
results
hanging around on the server, especially since they are quite
computationally 
expensive to produce. At the moment the layout of static results pages
are all
hard-coded, but it would make enormous sense to use the same Albatross
templating
facilities used elsewhere in teh app to generate these static pages as
well.

> 
> My second question, which I haven't been able to solve, regards
> macros.  I have pages which are based on a master template, along
> these lines:
> 
> master.html:
> 
>     <al-macro name="master">
>       Stuff stuff stuff
>       <al-usearg name="body">
>       Blah blah blah
>     </al-macro>
> 
> somepage.html:
> 
>     <al-expand name="master">
>     <al-setarg name="body">
>         Foo bar, foo bar, foo bar...
>     </al-setarg>
>     </al-expand>
> 
> Make sense?
> 
> Now, what I'd _really_ like is to have a number of templates which are
> used to build each page.  In particular, a large chunk of master.html
> is a sidebar table which is rather large: I'd love to be able to break
> that out into a seperate template then bring it in in either
> master.html or better yet, somepage.html (then I could have a choice
> of sidebars for different pages, all of which use the same master).

Nested template processing (as opposed to macro expansion and
header/footer
inclusion within a single template)? Is that what you mean?

Tim C
Fellow Albatross User



More information about the Albatross-users mailing list