tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Tapestry Wiki] Update of "Tapestry5WhereToStoreExternalResources" by DanielJue
Date Fri, 08 Jun 2007 14:22:22 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.

The following page has been changed by DanielJue:
http://wiki.apache.org/tapestry/Tapestry5WhereToStoreExternalResources

------------------------------------------------------------------------------
   * In case of CSS/JS/images for components, have a look into the way the T5 Grid or Palette
component is constructed, since they have their own js, css and images.
  [Thanks go to Daniel Jue, who answered my question on June 7, 2007]
  
+ 
+ For example, if you have this file:
+ 
+ src/main/webapp/css/MyStyle.css
+ 
+ You can access it in your page or component Java class like this:
+ 
+ {{{
+ @Inject
+ @Path("context:css/MyStyle.css")
+ private Asset thestyle;
+ }}}
+ 
+ And then in your page or component template:
+ {{{
+ <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ <head>
+ <title>My Title</title>
+ <link rel="stylesheet" type="text/css" href="${thestyle}"/>
+ </head>
+ ...
+ </html>
+ }}}
+ 
+ Similarly, having
+ src/main/webapp/css/MyLogo.gif
+ Page or Component Class:
+ {{{
+ @Inject
+ @Path("context:images/MyLogo.gif")
+ private Asset thelogo;
+ }}}
+ 
+ Page or Component Template (the html):
+ {{{
+ <img src="${thelogo}" />
+ }}}
+ 

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


Mime
View raw message