Well, in Tapestry 4.1.1 there's a new component @Style that can append stylesheets inside <HEAD>. It can be used from anywhere - even components can have their needed stylesheets appended. Here's some example usages:
<link jwcid="@Style" href="main.css" media="all"/> <link jwcid="@Style" href="asset:style1" title="main"/> <link jwcid="@Style" href="asset:style2" title="other" rel="alternate stylesheet"/> In Tapestry 4.0 or older, you should make use of the delegate parameter of @Shell You supply it with an IRender implementation, and it gets rendered just before </HEAD> Brian Long wrote: > Nick, > > that worked perfectly, thanks! I just had to change a few things for > it to > comply with T4, but unfortunately now I'm faced with another problem, > there's no titles on my stylesheets. > > Border.html > <html jwcid="shell" > stylesheets="ognl:{assets.stylesheet1,assets.stylesheet2 > }"> > > Border.jwc > <asset name="stylesheet1" path="context:css/style.css" /> > <asset name="stylesheet2" path="context:css/template.css" /> > > gives me: > > <link rel="stylesheet" type="text/css" > href="/fast-store-app/css/style.css" > /> > <link rel="stylesheet" type="text/css" > href="/fast-store-app/css/template.css" /> > > but I'd like: > > <link rel="stylesheet" type="text/css" > href="/fast-store-app/css/style.css"title="default" > /> > <link rel="stylesheet" type="text/css" > href="/fast-store-app/css/template.css" title="super"/> > > So as I can select them on the fly from my browser's view->use style > setting. If you or anyone else has already figured out how to do this I'd > like to hear how it's done. > > Thanks again, Brian. > > > On 9/1/06, Nick Westgate <[EMAIL PROTECTED]> wrote: >> Hi Brian. >> >> Hopefully someone using T4 can offer you more help, >> but in my current T3 project I do this via ... >> >> Border.jwc - which has a stylesheets parameter: >> >> ... >> <component-specification >> class="blah.blah.Border" >> allow-informal-parameters="no"> >> >> <parameter name="stylesheets" type="java.lang.Object" > direction="in"/> >> >> <component id="shell" type="Shell"> >> <binding name="title" expression="title"/> >> <binding name="stylesheets" expression="stylesheets"/> >> <binding name="doctype"> >> 'html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"' >> </binding> >> </component> >> ... >> >> SomePage.html - which passes the array of stylesheet assets: >> >> <html> >> <head> >> </head> >> <body jwcid="$content$"> >> <div jwcid="border" stylesheets="ognl:{assets.common, assets.apply}"> >> ... >> >> SomePage.page - which defines the css assets: >> >> <context-asset name="common" path="css/common.css"/> >> <context-asset name="apply" path="css/apply.css"/> >> >> Cheers, >> Nick. >> >> >> Brian Long wrote: >> > Hi all, >> > >> > I'm afraid I might have dug myself into a hole (again!), but I hope > someone >> > my have already encountered this problem and is willing to let me know > of a >> > possible solution. >> > >> > I'm trying to add multiple stylesheets to my web project, I'm >> currently >> > using a @Shell component to enclose my web pages, this has a single >> > stylesheet as per the example on the tapestry website. >> > >> > <span jwcid="@Shell" stylesheet="asset:stylesheet" title="MyCorp > Customer >> > Login"> >> > >> > I want to add some more, and according to the component description > there's >> > a parameter "stylesheets" that will take an array of IAssets, this is > want >> > I'd like to do, the only problem is that my shell in inside a custom >> > @Border >> > component. >> > >> > Soooooo, I have a Border.html and Border.jwc and I have to try and > create >> > an array of IAssets (my list of stylesheets). How do I do this, >> create a >> > Border.java? >> > >> > Any suggestions would be much appreciated . . . >> > >> > /Brian. >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > -- Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / J2EE Consulting --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]