[Seaside] How to do the ubiquitous home button?

Avi Bryant avi at beta4.com
Fri Aug 8 14:27:15 CEST 2003


On Fri, 8 Aug 2003 tblanchard at mac.com wrote:

> I've got a page that wants to have a link on every page back to home.
> The app has the concept of logging in which provides access to certain
> features but other features don't require logging in.  If I didn't have
> to track the that user had logged in I'd just use a raw url and let
> them get another session.  But I have to keep track of who is logged in
> (if anyone).
>
> The better behavior would be to backtrack until the page is the home
> page (ie - recover to the last home page view).
>
> Suggestions for a general solution?  (I could do custom implementation
> of this button on each page but I'd rather not).

- Create a frame component, and set it as your entry point.  This should
have a 'contents' ivar which holds the home component.  Its
#renderContentOn: should look, minimally, like

renderContentOn: html
  html anchorOn: #home of: self.
  html render: contents

- Add a #home method which looks like this:

home
  contents clearDelegate

This will clear away the #call: chain and snap you back to the original
component.

That make any sense?



More information about the Seaside mailing list