Hey Guys,
Working on converting a theme to Drupal. In the CSS file, it references images, and the image directory is in the theme directory... but it can't seem to find it? What's the path?
mytheme/images/* <-- where my images are
url(images/blah.jpg); <-- css, can't seem to find it?
I've also tried: /images/blah.jpg, and ./images/blah.jpg
And I've set the permissions on the server to match those as in the Zen theme.
Also used the Firefox Web Developer Extension to find the broken images, and it's all of them. Clicking on any of the links brings up a standard Drupal Page Not Found error.
The links according to the extension look like this:
http://www.mywebsite.com/themes/images/blah.jpg
This is driving me nuts! Any know the obvious thing I've probably overlooked :).
Thanks!
-gary
Comments
relative to the .css file
That's exactly what you should use : a relative path, relative to your stylesheet.
Is your style.css file really in the 'mytheme' folder, though ?
Caroline
Who am I | Where are we
11 heavens
I got the same
I got the same problem...
but my css files can't seem to change the images urls when I edit them...
I can edit anything on them... but the urls seem to be static!!
i'm going crazy!
========
André Luiz
I found the answear
I found the answear myself...
the thing is: drupal was adding by itself the path: /drupal/sites/all/css before my path to the image...
so I put my own /drupal/sites/all/themes/themename/images/* and it worked either with abled as disabled css optimization...
========
André Luiz
Odd one that...
Usually, I use url(images/filename.jpg) with no problems. The images are in the "images" folder which is in the theme folder. Hence the path to an image will be: http://mysite.com/themes/themename/images/filename.jpg
The link you show above indicates that its not seeing your theme's folder. Have you tried adding the themename folder in the url() declaration? i.e. url(themename/images/filename.jpg). Normally you shouldn't have to, but in this case it looks like you need to.
______________________________________________________________________________________________________
Need help? Check the FAQ and the Handbooks first.
______________________________________________________________________________________________________
Nevermind
It seemed to have worked out. I'm not exactly sure what I did (and yes, I had cleared the cache before). But images/blah.jpg eventually got picked up. Yay for sanity! :).
Same problem
I'm having the same issue. Seems crazy to have to sit and wait for the magic to happen. I've tried different browsers so I'm sure it's not cache related.
DOUGH!
the image I uploaded to my images directory did not have the correct permissions to be read by the world. All fixed now.
You can change your
You can change your permission for the file in your server depending.
In your server you can set the permission read or write or execute for the admin/client side.
And simply you can run the cron Administration menu-> Run cron.
And you can check the permission for the content for the users.
Hope these any ways will help you.
Thanks
- - -
Mani
Solution
Try this
url("../images/your_image.png") no-repeat scroll 0 0 transparentWhere
../imagesis a directory inside your theme folder.Cheers!!!
Got Nothing
I've been trying to work out this very same issue all day today and I still don't know what's going on. I know the path to my image is /sites/default/files/myButton.jpg (uploaded to that location via the media module) and I've tried every variation of this as well as using the full url, trying it with/without parentheses, and nearly every suggestion here. I've even created an images folder in my theme folder and tried it that way but I got nothing. The only thing that I'm not clear on here is the permissions or public access to the images but the files folder is set as my public folder and I saw nothing to check or uncheck in the people/permissions area. Any other suggestions?
background-image: url(/sites/default/files/myButton.jpg) no-repeat right;Try this!! i had the same issue n it worked for me
assuming your images folder is within your theme folder like this : your_theme_folder/images
background-image: url(../images/myButton.jpg);
That was it and I nearly had
That was it and I nearly had it myself before writing too. Thanks!
the best solution
The best soluton. Thanks.
../images/Don forget the spaces.
background-image:[space]url[space](../images/logo.png);
Those spaces are not
Those spaces are not necessary (I don't use them myself).
Contact me to contract me for D7 -> D10/11 migrations.