[Seaside] state of the aubergine
Avi Bryant
avi@beta4.com
Mon, 22 Apr 2002 21:10:20 -0700 (PDT)
On Mon, 22 Apr 2002, Nevin Pratt wrote:
> > But, if I instead just use <img src="@foo.jpg">
>
> ^^^^^^^^^
> But again, why would I ever want a trailing ".jpg" here? If there is a
> trailing ".jpg" (or ".gif", for the matter), wouldn't I *always* want it
> statically served? And in that case, why would I want the leading "@"?
Well, by "statically served" what you mean is "have a document root
prepended". The @ is what's alerting Seaside that this tag should not be
output verbatim, but should be treated specially. The @ is actually just
a macro that Seaside uses by default; if you have another rule that you
want to encode, it's quite easy to add another macro. It sounds like you
want one that takes all <img> tags with a src attribute ending in .gif,
.jpg, etc, and prepend a certain path to them. If you take a look at the
Seaside-Macros category you'll see some examples to emulate. To see where
they're used, look at IATemplate>>defaultExpander.
> And if not, should we modify Seaside to behave that way? Or should I
> handle it at the Comanche/Seaside interface (i.e., IAKom) (i.e., hack
> out the seaside portion of the URL when it sees the trailing ".jpg" or
> ".gif" so that the URL never gets dispatched to Seaside)?
This makes me uneasy. I'd much rather see it done as a macro.
Avi