jeudi 6 mars 2014

Symfony2 path to assets in css


Vote count:

0




I have following problem:


i try to load pictures with css. But they can't be found.


My css file:



.newsMenu {
background-image: url(../gfx/bannerSeite.png);
background-repeat: no-repeat;
background-size: 900px;
}


my TwigTemplate which loads css:



{% stylesheets
'bundles/doublebeatswebsite/css/index.css'
'bundles/doublebeatswebsite/css/jquery.mCustomScrollbar.css'
output="bundles/doublebeatswebsite/css/compiled/main.css"
filter="cssrewrite"
filter="yui_css"
%}


My DirectoryStructure



+src
+DoubleBeats
+WebsiteBundle
+Resources
+public
+css
-index.css
-jquery*.css
+web
+bundles
+doublebeatswebsite
+css
+compiled
-main.css
-main_index.css
-main_jquery*.css
-index.css
-jquery*.css


Im browser wird durch cssrewrite der pfad in folgendes Ergebnis umgewandelt:



url("../../../../../bundles/doublebeatswebsite/gfx/*.png")

Die angegebene URL konnte nicht geladen werden


I've allready tried absolute path in the css file what also didn't work (and what i try to avoid)



url(/bundles/.../gfx/*.png)


I tried also without cssrewrite and with



background-image: url(../../gfx/bannerSeite.png);


Nothing helps. Anybody sees my mistake? Thanks for helping!



asked 3 mins ago

Martin

352





Aucun commentaire:

Enregistrer un commentaire