I would investigate using Block and RenderBlock; with some planning and care
you can do some very complicated things.
Basically, you have some number of Blocks for the different parts of your
skin. This is a lot like the Portal.
Define a couple of pages, one for each skin, say TechSkin, CowSkin and
HalleBerrySkin.
Each Skin page defines Blocks for the major parts of the page:
say, "topNav", "leftNav" and "bottom".
Your Border component will get a reference to the correct Skin page, and get
the correct Block based on name. Obviously, this is something to do in code.
You then have stuff in your template:
<span jwcid="@RenderBlock" block="[[ skinnedTopNav ]]"/>
(I'm using the new 2.4 syntax for convienience).
public Block getSkinnedTopNav()
{
IPage skinPage = getSkinPageForSelectedSkin();
return (Block)skinPage.getComponent("topNav");
}
Yes, this is a bit awkward; its one of the few things that Tapestry isn't all
that good at, I think ... though equivalent solutions in other environments may
be even worse.
Another option, to mix in, is to have a SkinObject with different
implementations, that can simply render the Skin's HTML directly. But then you
are fighting uphill if your skin needs to have links or forms in it.
--
[EMAIL PROTECTED]
http://tapestry.sf.net
> Thanks I'll look into creating a custom AssetService. That would take care
> of A1 and A2 because the content layout is the same. Any idea how I would
> take care of A3 where the content is the same but the layout is different?
>
> steve
>
>
>
>
>
> >From: "Geoff Longman" <[EMAIL PROTECTED]>
> >To: "Steve G"
> ><[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
> >Subject: Re: [Tapestry-developer] Site with multiple skins
> >Date: Tue, 17 Dec 2002 10:10:01 -0500
> >
> >I think that if all you need are custom stylesheets and images, ie the
> >content layout is identical for all users, then a custom Asset Service
> >could
> >construct the appropriate asset urls based on user type.
> >
> >Look at IAssetService
> >
> >Geoff
> >
> >
> >----- Original Message -----
> >From: "Steve G" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Tuesday, December 17, 2002 9:53 AM
> >Subject: [Tapestry-developer] Site with multiple skins
> >
> >
> > > Hi all,
> > >
> > > I am evaluating tapestry for an upcoming project. Basically I'd like to
> >have
> > > one site but reskin the site based on the type of user logging in. For
> > > example, say I have 3 types of users: A1, A2, and A3. A1 and A2 share a
> > > similar template except for different styles sheet and images. A3 has a
> > > completely different look and feel. That means the components are the
> >same
> > > just totally rearranged.
> > >
> > > I was reading through the docs on how tapestry handles localization with
> > > template. I was thinking I could be something like that with the
> >scenarios
> > > above. So, if a user logs into the site and is of type A1 and A2 the
> > > template Border.html (default) would be used for the layout. If the user
> > > were of type A2 the Border_A2.html template would be used because it is
> > > based on a different template. All would use the same Border.jwc
> > > specification
> > >
> > > Is it possible for me to do something like this? If so, how difficult
> >would
> > > it be? Any other suggestions on how I could do this?
> > >
> > > thanks
> > > steve
> > >
> > >
> > > _________________________________________________________________
> > > The new MSN 8: smart spam protection and 2 months FREE*
> > > http://join.msn.com/?page=features/junkmail
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This sf.net email is sponsored by:
> > > With Great Power, Comes Great Responsibility
> > > Learn to use your power at OSDN's High Performance Computing Channel
> > > http://hpc.devchannel.org/
> > > _______________________________________________
> > > Tapestry-developer mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/tapestry-developer
> > >
> >
> >
> >
> >-------------------------------------------------------
> >This sf.net email is sponsored by:
> >With Great Power, Comes Great Responsibility
> >Learn to use your power at OSDN's High Performance Computing Channel
> >http://hpc.devchannel.org/
> >_______________________________________________
> >Tapestry-developer mailing list
> >[EMAIL PROTECTED]
> >https://lists.sourceforge.net/lists/listinfo/tapestry-developer
>
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> With Great Power, Comes Great Responsibility
> Learn to use your power at OSDN's High Performance Computing Channel
> http://hpc.devchannel.org/
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer
-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer