You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jose Gonzalez Gomez <jg...@opentechnet.com> on 2004/09/30 19:28:40 UTC

Images in backgrounds and CSSs

    Hi there,

    I know you can use the Image component with its corresponding asset 
to let Tapestry care of finding the image, localizing it using diferent 
images... but what about the following scenarios:

   1. If I have a image in a background attribute (for exmaple in a
      td)... currently I use a ognl:asset expression to load the image
      using Tapestry, but I no longer preview the template correctly. Is
      there any way to specify the image while keeping the preview
      capabilities of Tapestry templates?
   2. If I have a URL (pointing to a image) in a CSS loaded using the
      style attribute of @Shell... can I use a ognl:asset expression there?

    Thanks in advance, best regards
    Jose

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


Re: Images in backgrounds and CSSs

Posted by Holger Stephan <tm...@frogleg.net>.
Jose: you can't apply OGNL in your external CSS (AFAIK) but you can
switch the entire CSS sheet to localize the interface. I'd say the OGNL
approach to handle the background image is more of a hack. But using an
asset to handle the CSS sheet dynamically is a clean solution. You can
import several sheets if needed, even on a component level.  

BTW, you may want to consider Sitemesh for this. I really like the extra
flexibility it gives you when handling the interface.

- Holger

On Thu, 2004-09-30 at 10:28, Jose Gonzalez Gomez wrote:
>     Hi there,
> 
>     I know you can use the Image component with its corresponding asset 
> to let Tapestry care of finding the image, localizing it using diferent 
> images... but what about the following scenarios:
> 
>    1. If I have a image in a background attribute (for exmaple in a
>       td)... currently I use a ognl:asset expression to load the image
>       using Tapestry, but I no longer preview the template correctly. Is
>       there any way to specify the image while keeping the preview
>       capabilities of Tapestry templates?
>    2. If I have a URL (pointing to a image) in a CSS loaded using the
>       style attribute of @Shell... can I use a ognl:asset expression there?
> 
>     Thanks in advance, best regards
>     Jose

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