[Seaside] Links and Components doubts

Andres Fortier andres at lifia.info.unlp.edu.ar
Thu Oct 23 17:48:00 UTC 2008


Hi Sebastian,
                       you may be interested in WANavigation and 
WASimpleNavigation for the menu stuff (I based on those classes to 
make a custom menu).

You may also want to take a look at WADecoration, which can help you 
to decouple the header/footer from the main page:

WADecoration:
I am an abstract decoration around instances of WAComponent. I can be 
added to aComponent by calling #addDecoration: and I change the basic 
behaviour or look of a component. There are several methods that can 
be overriden to archive this:

- #renderContentOn: to emit xhtml around the decorated component. Call 
#renderOwnerOn: to let the owner emit its output.
- #processChildCallbacks: to intercept the callback processing of the 
owner.
- #handleAnswer: to intercept the answer processing.

HTH,
         Andrés

Sebastian Van Lacke escribió:
> Hello, 
> 
> I'm from Argentina and I am working on a Seaside project. I don't speak English very well, so I hope you understand...
> 
> I need to recreate an old site using Seaside, and I and I'm having problems with the structure of the site.
> 
> My page has a header, menu, and a footer (which are repeated throughout the site) and a body that changes for each page of the site, 
> depending on the option chosen on the menu.
> 
> CSRootComponent>>renderContentOn: html
>  html div
>   id:'allContent';
>   with:[
>    html render: header.
>    html render: menu.
>    self renderBodyOn: html.
>    html render: footer.
>   ]
> 
> ---------------------------------------------------------------------------------------------
> The component menu, displays a horizontal menu with links to different pages on the site.
> 
> CSMenuComponent>>renderContentOn: html
>  html div
>   id: 'menu';
>   with: [
>    html unorderedList: [
>     self  renderMenuItemsOn: html.
>     ].
>   ].
> ---------------------------------------------------------------------------------------------
> CSMenuComponent>>renderMenuItemsOn: html
> 
>  menuItems do: [:item |
>   html listItem with: [
>    html anchor 
>     callback: item value;
>     with: item key.
>   ].
>  ]
> 
> ----------------------------------------------------------------------------------------------
> CSMenuComponent>>initialize
>  
>  super initialize.
>  menuItems := OrderedCollection new.
>  self addMenuItem: 'Company Info' withBlock: [ self companyInfo].
>  self addMenuItem: 'Products' withBlock: [ self products ].
>  self addMenuItem: 'Downloads' withBlock: [ self downloads ].
>  self addMenuItem: 'Resources' withBlock: [ self resources ].
>  self addMenuItem: 'Support' withBlock: [ self support ].
>  self addMenuItem: 'Contact Us' withBlock: [ self contactUs ].
> 
> ----------------------------------------------------------------------------------------------
> 
> where each of the links should display a new page with the same structure as before, but with a different body.
> 
> It is right to create a component for each link ? For example, CSCompanyInfoComponent for companyInfo link.
> How I call that component, from CSMenuComponent>>companyInfo method, to render in a new page??
> I am confused by the fact that I don't have a renderCanvas to speak in that context.
> 
> Thanks!!!
> 
> Sebastian
> 
> 
> Sebastian Van Lacke | Developer |  caesar systems | see clearly. decide smarter.
> 
> svanlacke at caesarsystems.com  | t: +1.281.598.8790 | t: +54.11.4389.0126 | www.caesarsystems.com 
> 
>  
> 
> This message and any attached documents contain information from Caesar Systems LLC that may be confidential/trade secret and/or privileged.  If you are not the intended recipient, you may not read, copy, distribute or use this information.  If you have received this transmission in error, please notify the sender immediately by telephone or by reply e-mail and then delete this message.
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


More information about the seaside mailing list