[Seaside] About a templating for **Static*** dummy web page
goran at krampe.se
goran at krampe.se
Sun Jan 8 23:53:43 CET 2006
Hi fellas!
Cees De Groot <cdegroot at gmail.com> wrote:
> Stephen Pair used to have a simple SSP package, I don't know where
> it's gone... Apart from that, HV2 is probably the easiest thing
> available, but not templating, it generates HTML in pretty much the
> same fashion as Seaside.
>
> On 1/8/06, stephane ducasse <stephane.ducasse at free.fr> wrote:
> > So I would like to know if there is a simple templating package for
> > ***purely static
> > dead with no objects plain HTML*** web pages.
> > Is HttpView2 such kind of beast?
HttpView2 is very simple and yes, IMHO it is such a beast - but it has
no included template mechanism currently. But hey - this is Smalltalk,
so it is a very small problem - and below is a link to a simple class
for templating.
With HV2 you would just do these things:
1. Create a subclass of HVTransientView.
2. Add a method called #default (in method category "urls" - important!)
and make it return something that responds to #asHttpResponse. In fact,
HTML in a String works just fine. You can use my MacroProcessor class if
you want to have something ASP-ish or whatever tickles your fancy. See:
http://squeak.krampe.se/MacroProc-gk.cs.gz
And then just do:
MyClass startOn: <port>
Done. :)
For other "pages" just implement other methods in the method category
"urls" - their name is the URL, like #hello would be
http://localhost:<port>/hello
regards, Göran
More information about the Seaside
mailing list