Muut
April 29, 2016, 7:32am
1
Hi, I seem to stumble across many issues in the current project im working on, that I can’t even replicate on other grav installations.
For some reason the relative urls in my CSS files are not being rewritten, even tho its enabled.
If i enable CSS pipelining and CSS rewrite the output for any background image in my css follows the following path/pattern.
grav/images/cd-top-arrow.svg
whereas it should be
grav/user/themes/themename/images/cd-top-arrow.svg
The moment i turn off CSS pipelining its working fine again.
I tried to replicate this on 2 different grav installations that i have running and there it works fine.
anyone else had this problem?
Muut
April 29, 2016, 8:05am
2
I never used CSS rewrite but isn’t it a special option for windows webhost? What is happening when you just turn on CSS pipeline without CSS rewrite?
Muut
April 29, 2016, 8:45am
3
Pipeline without CSS rewrite results in the img path being incorrect.
Normally, to my understanding, the CSS rewrite would rewrite the URL to a path that is correct. At least that how it works on my other installations.
The problem I have now is that with Pipeline enabled the image path breaks. And enabling CSS rewrite doesn’t seem to do anything at all.
I believe the windows webhost specific setting you refer to is “CSS minify Windows override”, but I have not enabled that setting.
Muut
April 29, 2016, 9:52am
4
ohh, right, I got confused between the two options. Maybe a temporary fix is adding {{ theme_url }} before your url
Muut
April 29, 2016, 5:56pm
5
You should use relative URLs in your CSS. Such as:
../images/cd-top-arrow.svg
These should be processed correctly.
Muut
April 30, 2016, 9:16pm
6
The URL in the CSS is relative, and works as it should. The problem surfaces once I enable CSS pipeline.
e.g.
background: #fff url('../images/menubg.jpg') no-repeat;
results in:
grav/images/menubg.jpg
should have been:
grav/user/themes/themename/images/menubg.jpg
---
Muut
May 1, 2016, 12:03am
7
I’m pretty sure this works on my setup, but can you create an issue here: https://github.com/getgrav/grav/issues so I can track it and look at it next week.
Thanks!
Muut
May 3, 2016, 8:12am
8
Hi Rhukster, I just double checked it again on a different installation, same server etc. where it’s working. The relative URL is rewritten and the output is correct.
Could there be any other setting that influences this?
Muut
May 4, 2016, 3:29pm
9
I can’t really say for sure what the cause is unless i can try to recreate it myself. If you open an issue and attach a copy of your user/
folder, i can do so.