You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Darren Foltinek <da...@frontrange.ca> on 2003/09/16 18:15:16 UTC

Multiple HTML templates?

Hi all,

I need to be able to have multiple HTML templates for a single Tapestry 
page or component.

There is currently a functionality described in the Tapestry Developer's 
Guide, Chapter 3: Localization with Templates, where different LOCALEs are 
mapped to different HTML templates.

I need to do a similar thing, where an external parameter provides the 
"skin style" for the current Visit.  The Skin parameter will then specify 
which HTML template to use.

Anybody have any idea how to do this?

Basically, I need to be able to append a Skin parameter to the HTML 
template file, for example:
MyPage.page uses default HTML template MyPage.html
With Skin parameter set to "MySkin", then MyPage would use MyPage-MySkin.html.

By the way, after using Tapestry for the last six months, I have come to 
the conclusion that IT TOTALLY ROCKS!   Thanks, Howard and Team, for 
putting together this great framework.

-- Darren


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple HTML templates?

Posted by Eric Everman <ev...@precedadesign.com>.
This really sounds like a Block / RenderBlock application.  Have you
checked into that option?

--ee

On Tue, 2003-09-16 at 13:22, Darren Foltinek wrote:
> Thanks for the suggestion, Richard.   You're right - the different skins 
> will only involve different page layouts, NOT different components, so the 
> PAGE and CLASS files remain the same for each page.
> 
> Might be possible to do with using CSS - I'm not sure how I'd completely be 
> able to specify layout using only CSS without modifying the HTML - you know 
> the kind of stuff that graphic artists give you to implement in HTML!!
> 
> And I don't want to have to define different TAPESTRY pages just for 
> different skins...
> 
> I was hoping somebody knew of a a method within 
> org.apache.tapestry.IComponent that I could override...
> 
> Thanks,
> -- Darren
> 
> 
> >>I need to be able to have multiple HTML templates for a single Tapestry 
> >>page or component.
> >>...
> >
> >Tapestry doesn't currently support this functionality as such. However 
> >there are 2 ways you could proceed.
> >
> >1. Use CSS - if the differently skinned pages contain the same components, 
> >just rearranged, then using CSS may be a cleaner solution. It is 
> >relatively easy in CSS for example, to have a HTML UL list rendered 
> >horiontally or vertically, which could be used for menus across the top or 
> >down the side. Then all you need to do is specify a user chosen skin 
> >specific CSS to assign to the sylesheet property of the Shell component 
> >and away you go.
> >
> >2. Override the validate method to not only check authorization, but also 
> >redirect to a differently skinned page. This is more appropriate if for 
> >example you want widely different looking pages, containing different 
> >components.
> >
> >Just some ideas...
> >
> >Richard.
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
-- 
Preceda Design LLC
www.precedadesign.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple HTML templates?

Posted by Darren Foltinek <da...@frontrange.ca>.
Thanks for the suggestion, Richard.   You're right - the different skins 
will only involve different page layouts, NOT different components, so the 
PAGE and CLASS files remain the same for each page.

Might be possible to do with using CSS - I'm not sure how I'd completely be 
able to specify layout using only CSS without modifying the HTML - you know 
the kind of stuff that graphic artists give you to implement in HTML!!

And I don't want to have to define different TAPESTRY pages just for 
different skins...

I was hoping somebody knew of a a method within 
org.apache.tapestry.IComponent that I could override...

Thanks,
-- Darren


>>I need to be able to have multiple HTML templates for a single Tapestry 
>>page or component.
>>...
>
>Tapestry doesn't currently support this functionality as such. However 
>there are 2 ways you could proceed.
>
>1. Use CSS - if the differently skinned pages contain the same components, 
>just rearranged, then using CSS may be a cleaner solution. It is 
>relatively easy in CSS for example, to have a HTML UL list rendered 
>horiontally or vertically, which could be used for menus across the top or 
>down the side. Then all you need to do is specify a user chosen skin 
>specific CSS to assign to the sylesheet property of the Shell component 
>and away you go.
>
>2. Override the validate method to not only check authorization, but also 
>redirect to a differently skinned page. This is more appropriate if for 
>example you want widely different looking pages, containing different 
>components.
>
>Just some ideas...
>
>Richard.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple HTML templates?

Posted by Richard Kirby <rb...@capdm.com>.
Darren Foltinek wrote:

> Hi all,
>
> I need to be able to have multiple HTML templates for a single 
> Tapestry page or component.
>
> ...

Tapestry doesn't currently support this functionality as such. However 
there are 2 ways you could proceed.

1. Use CSS - if the differently skinned pages contain the same 
components, just rearranged, then using CSS may be a cleaner solution. 
It is relatively easy in CSS for example, to have a HTML UL list 
rendered horiontally or vertically, which could be used for menus across 
the top or down the side. Then all you need to do is specify a user 
chosen skin specific CSS to assign to the sylesheet property of the 
Shell component and away you go.

2. Override the validate method to not only check authorization, but 
also redirect to a differently skinned page. This is more appropriate if 
for example you want widely different looking pages, containing 
different components.

Just some ideas...

Richard.



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple HTML templates?

Posted by Kris Rasmussen <kr...@yahoo.com>.
I too would like to be able to do this as it would be very powerfull for things like having a pocket pc vs. regular version of the site. You guys should definatly consider implementing it.
 
Kris

Darren Foltinek <da...@frontrange.ca> wrote:
Hi all,

I need to be able to have multiple HTML templates for a single Tapestry 
page or component.

There is currently a functionality described in the Tapestry Developer's 
Guide, Chapter 3: Localization with Templates, where different LOCALEs are 
mapped to different HTML templates.

I need to do a similar thing, where an external parameter provides the 
"skin style" for the current Visit. The Skin parameter will then specify 
which HTML template to use.

Anybody have any idea how to do this?

Basically, I need to be able to append a Skin parameter to the HTML 
template file, for example:
MyPage.page uses default HTML template MyPage.html
With Skin parameter set to "MySkin", then MyPage would use MyPage-MySkin.html.

By the way, after using Tapestry for the last six months, I have come to 
the conclusion that IT TOTALLY ROCKS! Thanks, Howard and Team, for 
putting together this great framework.

-- Darren


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software