Foros de discusión

URL for background-image wrong in Liferay 6.2

Daniel Niklas, modificado hace 10 años.

URL for background-image wrong in Liferay 6.2

Junior Member Mensajes: 46 Fecha de incorporación: 8/11/10 Mensajes recientes
Hi,

my css-file contains:

.test {
background: url(../images/test.jpg);
}

The css-file (in the Browser) contains the following URL:
.test {
background: url(@base_url@/images/test.jpg);
}

What ist going wrong?
Liferay Version 6.2.10 EE GA1

Best regards
Daniel
thumbnail
Vilmos Papp, modificado hace 10 años.

RE: URL for background-image wrong in Liferay 6.2

Liferay Master Mensajes: 529 Fecha de incorporación: 21/10/10 Mensajes recientes
Did you run the build-css target when you built your theme?
Daniel Niklas, modificado hace 10 años.

RE: URL for background-image wrong in Liferay 6.2

Junior Member Mensajes: 46 Fecha de incorporación: 8/11/10 Mensajes recientes
Hi,

i am using the maven-sdk: mvn package.
While packaging the goal "liferay-maven-plugin:6.2.0-ga1:build-css" is called.

Daniel
thumbnail
Byran Zaugg, modificado hace 10 años.

RE: URL for background-image wrong in Liferay 6.2 (Respuesta)

Expert Mensajes: 252 Fecha de incorporación: 6/04/12 Mensajes recientes
Check your build log, to ensure there were no SASS parsing errors, when you built your theme.

Ant will still say "Build Successful" and build the WAR, even if there are SASS errors.

See: LPS-43671
Daniel Niklas, modificado hace 10 años.

RE: URL for background-image wrong in Liferay 6.2

Junior Member Mensajes: 46 Fecha de incorporación: 8/11/10 Mensajes recientes
Thanks for your reply and sorry for my late answer - i was on vacation...
You're right: there were parsing errors. Maven says "Build Successful", too.

Without parsing errors there was another Problem:
In custom.css there are imports to other files like:
@import url(styles.css);

In styles.css there is a definition for background like this:
background: url('../images/test.jpg') center top no-repeat;

The result was an url like this:
background: url('<correct-context-name>/css//<correct-context-name>/css/../images/div/test.jpg') center top no-repeat;

When the import is like this:
import "import-file.css";

Then everything is OK:
background: url('../images/test.jpg') center top no-repeat
vishwanath s, modificado hace 9 años.

RE: URL for background-image wrong in Liferay 6.2

New Member Mensajes: 3 Fecha de incorporación: 24/06/14 Mensajes recientes
Even i am getting the same glitch which is causing empty images on the webpage.
Can someone pls suggest how to resolve this issue.
Samrat Dhar, modificado hace 9 años.

RE: URL for background-image wrong in Liferay 6.2

New Member Mensaje: 1 Fecha de incorporación: 14/08/13 Mensajes recientes
having the similar problem in liferay 6.2 CE for custom theme
In my <themeProject-theme>/docroot/_diff/css/cutom.css - I have css like -
url("../images/background.gif")

but in browser, its giving 404 error with below kind of url for the background image

404 Not Found - http://localhost:8080/themeProject-theme/css/@base_url@/images/background.gif"

Please help.
thumbnail
Raphael Ferreira, modificado hace 9 años.

RE: URL for background-image wrong in Liferay 6.2

New Member Mensajes: 2 Fecha de incorporación: 27/08/14 Mensajes recientes
I have a similar problem too. Does anyone has the solution?
thumbnail
Felix Gonzalez de Santos, modificado hace 9 años.

RE: URL for background-image wrong in Liferay 6.2

New Member Mensajes: 5 Fecha de incorporación: 12/02/11 Mensajes recientes
I have the same problem, there are any new notice?
thumbnail
Byrån Zaugg, modificado hace 9 años.

RE: URL for background-image wrong in Liferay 6.2

Expert Mensajes: 252 Fecha de incorporación: 6/04/12 Mensajes recientes
Samrat Dhar:
404 Not Found - http://localhost:8080/themeProject-theme/css/@base_url@/images/background.gif"


I've seen a similar issue, but it was because I was building my theme with 6.1.30 and deploying to 6.1.20. For 6.2, I'm not sure what it would be.