You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chaitanya Laxminarayan <Ch...@webifyinc.com> on 2003/06/06 19:47:47 UTC

how do you link in stylesheets/javascript

How do I link in stylesheets/javascript in my pages? Here is the code I am using. Please be detailed in your answer. I am a newbie to Tapestry.

Here is my html template. It render properly but with out the style sheets or javascript? 

<html>
<head>
 <link rel="stylesheet" type="text/css" href="css/claimsnet.css" title="style">
 <title>Webify Health Services Network</title>
</head>

<span jwcid="$content$">
<span jwcid="@Shell" stylesheet="ognl:assets.stylesheet" title="Webify Health Services Network">
<body jwcid="@Body">
<span jwcid="@Script" script="/css/contents.script"/>
</body>
</span>
</span>
</html>

How can skiining be handled?

Posted by Colin Sampaleanu <co...@exis.com>.
I am interested in finding out if it's possible to have a Tapestry app 
support multiple skins (look and feels) simultaneously.  My hunch is 
that a mechanism which would work would be something like the 
'Localization with Templates' description in the Developers Guide. That 
is, each page has multiple templates available, and the right template 
is picked for that user based on some criteria (such as the initial url 
they came into the app on, or a setting fed to Tapestry, similar to the 
locale).

My question is if there is any easy mechanism to handle this today, and 
if anybody is doing it?

Regards,

Colin



Re: how do you link in stylesheets/javascript

Posted by Mindbridge <mi...@yahoo.com>.
Hi,


Stylesheet:

The following line seems to define what you need properly:

<span jwcid="@Shell" stylesheet="ognl:assets.stylesheet" title="Webify
Health Services Network">

What the "ognl:assets.stylesheet" means, however, is that you need to
declare an 'asset'  called 'stylesheet' that points to your stylesheet. You
can do that in your .page file using the following line:

<context-asset name="stylesheet" path="css/claimsnet.css"/>

There are different types of assets, this one refers to files in the web
application context (where the web pages typically reside). There is
probably a simpler way to do that, but I have not followed this part of the
framework development (someone else help out?)


Script:

Again, your code is correct with one small exception:

<span jwcid="@Script" script="/css/contents.script"/>

The path that is passed here refers to the classpath (where the Java classes
usually reside), rather than the context path. I am guessing that in your
case this file is not on the classpath, but in the context instead.


Btw, here is a link to Component Reference (in case you don't already use it
:)

http://jakarta.apache.org/tapestry/doc/ComponentReference/index.html

It contains info on the standard Tapestry components and may be helpful in
similar situations.

Best regards,
-mb

----- Original Message ----- 
From: "Chaitanya Laxminarayan" <Ch...@webifyinc.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, June 06, 2003 8:47 PM
Subject: how do you link in stylesheets/javascript


How do I link in stylesheets/javascript in my pages? Here is the code I am
using. Please be detailed in your answer. I am a newbie to Tapestry.

Here is my html template. It render properly but with out the style sheets
or javascript?

<html>
<head>
 <link rel="stylesheet" type="text/css" href="css/claimsnet.css"
title="style">
 <title>Webify Health Services Network</title>
</head>

<span jwcid="$content$">
<span jwcid="@Shell" stylesheet="ognl:assets.stylesheet" title="Webify
Health Services Network">
<body jwcid="@Body">
<span jwcid="@Script" script="/css/contents.script"/>
</body>
</span>
</span>
</html>

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