[Seaside] Document root on Seaside 2.x? & writing docs

Avi Bryant avi at beta4.com
Sun Feb 2 19:08:15 CET 2003


On Sun, 2 Feb 2003, Giovanni Giorgi wrote:

> Excuse me, I cannot find the document root property in the configure
> page of
> Seaside 2.0 (from http://localhost:9090/seaside/config/ clicking on a
> "configure" link).
>
> I am referring to the FAQ ("So Seaside generates the HTML for my page[...]Now,
> how do I place an image on the page there? Just assume a <img> tag for a simple
> case." )

That FAQ (and almost all of the content on the wiki) assumes Seaside 0.9x,
which is extremely different from current releases.  I'll make it a
priority to clean that up soon.

> How can I set the dir "/seaside/documentroot" as docroot for referencing
> gifs and so on?
> Can you provide an example?

The best way of using an image in a Seaside2 component is with the
HTMLRenderer>>imageWithForm: method.  This assumes you have read your GIF
into a Form object already.

For example, you might have a class variable somewhere that gets images
loaded into it in an initialize method:

initialize
  MyImages := Dictionary new.
  MyImages at: #GoButton put: (ImageReadWrite formFromFileNamed:
'go.gif').

In the renderContentOn: method of a component, you might do this:

renderContentOn: html
  ...
  html imageWithForm: (MyImages at: #GoButton).
  ...

> I'd like to write some documentation on Seaside if you like...I think it is a
> very productive tool and...I have yet done a tutorial for Squeak:
> <http://daitanmarks.sourceforge.net/or/squeak/squeak_tutorial.html>

That's great; if you write and post some documentation, I'd be happy to
link to it from the Seaside site.

Cheers,
Avi




More information about the Seaside mailing list