Forum: Typo Referencing an image from within a CSS file of a theme

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F0fb7fb81c0604bf4c6747df54930b3f?d=identicon&s=25 Tobias Weisserth (polarapfel)
on 2009-04-05 13:41
(Received via mailing list)
Hi everybody,

I can't figure out something that's probably not that complicated. Maybe
you
can sort this out easily for me.

I have a theme called "mytheme" residing in themes/mytheme. That theme
folder looks like this:

themes
             \mytheme
                             \... (some stuff)
                             \images\bg_header.jpg
                             \stylesheets
                                               \css
                                                      \application.css
(this
is included in the main layout and works)
                                                      \screen

\basemod.css (this is included from within application.css and works)

Now, within basemod.css I am doing this:

  #header { padding: 323px 2em 1em 20px; color: #000; background: #000
url(../../images/bg_header.jpg) no-repeat scroll left top; }

But when running Typo using Mongrel (from within Netbeans 6.5) I am
getting
this when it tries to access the bg_header.jpg file:

Processing ThemeController#stylesheets (for 127.0.0.1 at 2009-04-05
11:52:06) [GET]
  Parameters: {"filename"=>"images/bg_header.jpg"}
  Trigger Load (0.1ms)   SELECT * FROM `triggers` WHERE (due_at <=
'2009-04-05 11:52:06')
  Blog Load (0.1ms)   SELECT * FROM `blogs` ORDER BY id LIMIT 1
Completed in 6ms (View: 0, DB: 1) | 404 Not Found [
http://localhost/stylesheets/theme/images/bg_header.jpg]

What is the correct way to refer to files in the images directory from
within stylesheets? Why is the request going to http:localhost and not
http://localhost:3000 where Mongrel is running? Calling the request URL
with
port 3000 directly within the browser does not work anyway, but I'm
curious.

Any help is welcome. Thanks!

Tobias W.
700f9a3b883e6a04d018f48290b1a3fd?d=identicon&s=25 de Villamil Frédéric (Guest)
on 2009-04-05 14:02
(Received via mailing list)
Le 5 avr. 09 à 11:57, Tobias Weisserth a écrit :

>                              \... (some stuff)
>
> '2009-04-05 11:52:06')
> Any help is welcome. Thanks!
>
> Tobias W.


Hi Tobias,

What you're looking for is ../../images/theme/some_picture.whatever

Cheers,
Frédéric

--
Frédéric de Villamil
"What's mine is mine. What's yours is still unsetteled" – Go player
proverb
frederic@de-villamil.com                        tel: +33 (0)6 62 19 1337
http://t37.net                       Typo : http://typosphere.org
This topic is locked and can not be replied to.