Hi everybody,

I know that the 'multiple skin/layout' discution is something frequently
discussed here, an most of the time the answer is "Use CSS my son". Well
that's indeed probably the best answer, but in some case it's not.

For instance, I'm building a site where people that uses the site can
participate by providing new skins/layout. Unfortunatly they are not all
XHTML/CSS gods. In fact most of them use the old HTML 4 way... I can
encourage them to deliver valid "XML" templates but not really more.

Well so I studied a bit Tapestry's code to look how the "skin/layout'
feature could be done knowing that tapestry still have to use 'Static'
templates.

Couldn't it be possible to implement the skin feature by 'extending' the
same idea as for the template localisation ?

For the moment, Tapestry -in
ComponentTemplateSourceImpl.locateTemplateResource() -gets the baseResource
for a given model (Page or Component) then it look's for a localized version
of the same template.

Supposing we have a kind of SkinManager in Session (so that each use can
display it's own selected skin) I wonder if it is difficult to insert a step
where the locateTemplateResource function looks into a special directory (
let's say into .skins - like there is .components and .pages dirs).

Exemple :

Let say that my user choose the "bluesteel" skin (info recorded in the
SkinManager) and I would like to display a simple component called myComp.

First Tapestry gets the baseTemplate from : 

${tapestryRoot}/components/myComp.html

then it try to look if there is teh component's template here

${tapestryRoot}/skins/bluesteel/components/myComp.html

finaly it tries to find the localized version from the "bluesteel" dir

If Tapestry does not find a Skinned template then it falls back to default
template

So ? Is it a good idea ? A bad one ? Maybe it causes performances issues
that I'm not aware off ? 

Should I change my nickname and hide ? :)

I hope that it will help a bit.

Cheer,

Martin


-- 
View this message in context: 
http://www.nabble.com/-T5--Skin-feature-tf4276008.html#a12171332
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to