Fórum

URL for background-image wrong in Liferay 6.2

Daniel Niklas, modificado 10 Anos atrás.

URL for background-image wrong in Liferay 6.2

Junior Member Postagens: 46 Data de Entrada: 08/11/10 Postagens Recentes
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 10 Anos atrás.

RE: URL for background-image wrong in Liferay 6.2

Liferay Master Postagens: 529 Data de Entrada: 21/10/10 Postagens Recentes
Did you run the build-css target when you built your theme?
Daniel Niklas, modificado 10 Anos atrás.

RE: URL for background-image wrong in Liferay 6.2

Junior Member Postagens: 46 Data de Entrada: 08/11/10 Postagens Recentes
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 10 Anos atrás.

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

Expert Postagens: 252 Data de Entrada: 06/04/12 Postagens Recentes
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 9 Anos atrás.

RE: URL for background-image wrong in Liferay 6.2

Junior Member Postagens: 46 Data de Entrada: 08/11/10 Postagens Recentes
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 9 Anos atrás.

RE: URL for background-image wrong in Liferay 6.2

New Member Postagens: 3 Data de Entrada: 24/06/14 Postagens Recentes
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 9 Anos atrás.

RE: URL for background-image wrong in Liferay 6.2

New Member Mensagem: 1 Data de Entrada: 14/08/13 Postagens Recentes
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 9 Anos atrás.

RE: URL for background-image wrong in Liferay 6.2

New Member Postagens: 2 Data de Entrada: 27/08/14 Postagens Recentes
I have a similar problem too. Does anyone has the solution?
thumbnail
Felix Gonzalez de Santos, modificado 9 Anos atrás.

RE: URL for background-image wrong in Liferay 6.2

New Member Postagens: 5 Data de Entrada: 12/02/11 Postagens Recentes
I have the same problem, there are any new notice?
thumbnail
Byrån Zaugg, modificado 9 Anos atrás.

RE: URL for background-image wrong in Liferay 6.2

Expert Postagens: 252 Data de Entrada: 06/04/12 Postagens Recentes
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.