[Seaside] More S-Exprs

Avi Bryant avi@beta4.com
Wed, 29 May 2002 14:29:53 -0700 (PDT)


On Wed, 29 May 2002, Jim Benson wrote:

> Avi,
>
> First, thanks for having the patience to answer these questions.

No prob.

> First, I'm not far enough to have a full grasp of Seaside yet. For example
> (and even though it's on the first page of the Seaside Design Overview ;-) I
> couldn't see that you get a HTML element 'href=' out of
>
> ( a sea:id: edit: '(edit)')

Ok, right.  I wonder if it's best to not use the href="@foo" notation
in the tutorials, that might lead to less confusion.
As I think I pointed out before, you *could* write, in sexprs,

(a href: '@edit:' '(edit)')

But I find that less natural, personally.

To make something clearer: the transformation that's happening at this
level is from href->sea:id, not the other way around.  That is, <a
href="@foo"> gets translated to <a sea:id="foo">.  The sea:id
attribute is the canonical form, which is why I don't bother using
anything else in the s-epxr templates.  That's also why it's irrelevant
what attribute you use (href/repeat/foo) because it all becomes a sea:id
once its parsed.  The only purpose of the @ notation is that it lets us
sneakily use whatever little fields are provided in dialog boxes in
WYSIWYG editors to enter in the info which is actually important, ie, the
sea:id.

Now, there is a separate "transformation" of sorts that happens much
later, when the element actually generates html, and then, indeed, an href
will be printed out... but that's a different kettle of fish.

Making any sense?

Avi