You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chuck Kring <cj...@pacbell.net> on 2010/08/04 08:33:15 UTC

Asset in css file?

  Hi everybody,

I'm trying to override the gif image used for tabs in the Chenillekit 
tabset.    This is specified in
the chenillekit TabSet.css  like this:

a.ck.tab {
       background:url("white-top-bottom.gif")repeat-x scroll 0 -1px 
transparent;
       .....
}

At this point I assume that the css file is not rendered, so I can't 
directly specify the gif as an asset.  Aside from returning the asset as 
a StreamResponse from an onActivate() event is there a better way to 
serve a gif file into a css-specified background?

Thanks,

Chuck

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


Re: Asset in css file?

Posted by Chuck Kring <cj...@pacbell.net>.
  Thanks.  That should work and it keeps the image in the web app.

On 8/4/2010 8:13 AM, Ville Virtanen wrote:
> The most efficient way (cpu cycle wise) is to bypass Tapestry all together
> and let httpd share the images. This approach however lacks the ability to
> version assets using the T5 facilities.
>
> The best way IMHO is to use relative paths in css (if there are "images" and
> "css" folders, then the images are referenced like ../images/image.png),
> this way the versioning is preserved and it just works. This method
> obviously has some limitations also. (Works only when your image and css are
> in the domain.)
>
> The images are exposed to web via two urls: versioned and non versioned.
> Hardcode one of those to the css is also an option. Use firebug or similar
> to get the url. If you use versioned url, you may have to change the url in
> css when upgrading the 3rd party lib.
>
> You don't have to (atleast in 5.1) expose the image as an asset to reference
> it in css or html.
>
>   - Ville
>
>
> Chuck Kring wrote:
>>    Of course.  But what is most efficient way to  return a Tapestry Asset
>> specified in the css file.  The css file is not a template.
>>
>> On 8/4/2010 4:23 AM, Steve Eynon wrote:
>>> You're probably better off just overriding the css to return the image
>>> you
>>> want.
>>>
>>> Steve.
>>> ---
>>> Sent on the move from my X10 Mini, so excuse the small words and spelling
>>> mistakes!
>>>
>>> On 4 Aug 2010 07:33, "Chuck Kring"<cj...@pacbell.net>   wrote:
>>>
>>>    Hi everybody,
>>>
>>> I'm trying to override the gif image used for tabs in the Chenillekit
>>> tabset.    This is specified in
>>> the chenillekit TabSet.css  like this:
>>>
>>> a.ck.tab {
>>>        background:url("white-top-bottom.gif")repeat-x scroll 0 -1px
>>> transparent;
>>>        .....
>>> }
>>>
>>> At this point I assume that the css file is not rendered, so I can't
>>> directly specify the gif as an asset.  Aside from returning the asset as
>>> a
>>> StreamResponse from an onActivate() event is there a better way to serve
>>> a
>>> gif file into a css-specified background?
>>>
>>> Thanks,
>>>
>>> Chuck
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>

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


Re: Asset in css file?

Posted by Ville Virtanen <vi...@cerion.fi>.
The most efficient way (cpu cycle wise) is to bypass Tapestry all together
and let httpd share the images. This approach however lacks the ability to
version assets using the T5 facilities.

The best way IMHO is to use relative paths in css (if there are "images" and
"css" folders, then the images are referenced like ../images/image.png),
this way the versioning is preserved and it just works. This method
obviously has some limitations also. (Works only when your image and css are
in the domain.)

The images are exposed to web via two urls: versioned and non versioned.
Hardcode one of those to the css is also an option. Use firebug or similar
to get the url. If you use versioned url, you may have to change the url in
css when upgrading the 3rd party lib.

You don't have to (atleast in 5.1) expose the image as an asset to reference
it in css or html.

 - Ville


Chuck Kring wrote:
> 
>   Of course.  But what is most efficient way to  return a Tapestry Asset 
> specified in the css file.  The css file is not a template.
> 
> On 8/4/2010 4:23 AM, Steve Eynon wrote:
>> You're probably better off just overriding the css to return the image
>> you
>> want.
>>
>> Steve.
>> ---
>> Sent on the move from my X10 Mini, so excuse the small words and spelling
>> mistakes!
>>
>> On 4 Aug 2010 07:33, "Chuck Kring"<cj...@pacbell.net>  wrote:
>>
>>   Hi everybody,
>>
>> I'm trying to override the gif image used for tabs in the Chenillekit
>> tabset.    This is specified in
>> the chenillekit TabSet.css  like this:
>>
>> a.ck.tab {
>>       background:url("white-top-bottom.gif")repeat-x scroll 0 -1px
>> transparent;
>>       .....
>> }
>>
>> At this point I assume that the css file is not rendered, so I can't
>> directly specify the gif as an asset.  Aside from returning the asset as
>> a
>> StreamResponse from an onActivate() event is there a better way to serve
>> a
>> gif file into a css-specified background?
>>
>> Thanks,
>>
>> Chuck
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Asset-in-css-file--tp29343059p29347500.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Asset in css file?

Posted by Chuck Kring <cj...@pacbell.net>.
  Of course.  But what is most efficient way to  return a Tapestry Asset 
specified in the css file.  The css file is not a template.

On 8/4/2010 4:23 AM, Steve Eynon wrote:
> You're probably better off just overriding the css to return the image you
> want.
>
> Steve.
> ---
> Sent on the move from my X10 Mini, so excuse the small words and spelling
> mistakes!
>
> On 4 Aug 2010 07:33, "Chuck Kring"<cj...@pacbell.net>  wrote:
>
>   Hi everybody,
>
> I'm trying to override the gif image used for tabs in the Chenillekit
> tabset.    This is specified in
> the chenillekit TabSet.css  like this:
>
> a.ck.tab {
>       background:url("white-top-bottom.gif")repeat-x scroll 0 -1px
> transparent;
>       .....
> }
>
> At this point I assume that the css file is not rendered, so I can't
> directly specify the gif as an asset.  Aside from returning the asset as a
> StreamResponse from an onActivate() event is there a better way to serve a
> gif file into a css-specified background?
>
> Thanks,
>
> Chuck
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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


Re: Asset in css file?

Posted by Steve Eynon <st...@alienfactory.co.uk>.
You're probably better off just overriding the css to return the image you
want.

Steve.
---
Sent on the move from my X10 Mini, so excuse the small words and spelling
mistakes!

On 4 Aug 2010 07:33, "Chuck Kring" <cj...@pacbell.net> wrote:

 Hi everybody,

I'm trying to override the gif image used for tabs in the Chenillekit
tabset.    This is specified in
the chenillekit TabSet.css  like this:

a.ck.tab {
     background:url("white-top-bottom.gif")repeat-x scroll 0 -1px
transparent;
     .....
}

At this point I assume that the css file is not rendered, so I can't
directly specify the gif as an asset.  Aside from returning the asset as a
StreamResponse from an onActivate() event is there a better way to serve a
gif file into a css-specified background?

Thanks,

Chuck

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