Foren

Unable to create a diff theme

thumbnail
Dieter Engelhardt, geändert vor 12 Jahren.

Unable to create a diff theme

New Member Beiträge: 18 Beitrittsdatum: 30.10.11 Neueste Beiträge
Hi i'm new to Liferay-Development
I try to create a new theme for the LR 6.1.0-RC1.
What i did is creating a new Liferay-Projekt-Theme with eclipse and the new liferay-SDK.

To see if it is working i just made a new css-file in _diff/ css/custo,css with just a modification of the body tag

body {
    background-color: #4F555B;
	background-image: url("../images/layout/bg-grad.gif");
	background-repeat: repeat-x;
	color: #FFFFFF;
	font-family: Verdana,Helvetica,sans-serif;
	font-size: 11px;
}


I expectet just an different beckground but the rest of the theme should stay untouched.
But what i see is a theme without any styling but the background.
What i'm doing wrong?

Thanx,
Dieter
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: Unable to create a diff theme

Liferay Legend Beiträge: 14915 Beitrittsdatum: 02.09.06 Neueste Beiträge
By default the parent theme is the styled theme which, even though it is named 'styled', doesn't really have much in the way of styling.

Edit the build.xml file and change the parent theme to 'classic', then rebuild. You'll end up w/ a theme that is mostly like the classic theme but with your changes added in.
thumbnail
Maarten van Heiningen, geändert vor 12 Jahren.

RE: Unable to create a diff theme

Regular Member Beiträge: 174 Beitrittsdatum: 05.02.09 Neueste Beiträge
Hi Dieter,

What happens when you run the build file is that source code is taken form your connected Liferay server from the two folders called "_styled" and "_unstyled". Located in the /ROOT/html/themes/ directory. Inside these two folders there is a basic setup of what a basic theme of Liferay needs to have in order for the portal to run.

So in other words you can drag&drop and config the portal more or less. What David suggests is a good options so you have a good starting point. this way you have a setup looking like the classic theme which you can now change to what you want it to look like.

But advice from Liferay is to stick to the "_styled" & "_unstyled" as these two are garanteed to work and in the future the "Classic" theme might have changes so your theme based upon this as it's "master" theme might also not work any more.

Best,
Maarten
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: Unable to create a diff theme

Liferay Legend Beiträge: 14915 Beitrittsdatum: 02.09.06 Neueste Beiträge
This is true, but I've always found starting from _styled or _unstyled requires so much more work than tweaking classic. Could be a result of most of my theme requirements typically would be a theme similar to classic w/ tweaks.

I certainly wouldn't want to start the sesamestreet.com theme using classic as the parent (probably more work to undo all of the classic theme stuff than building out from the _styled or _unstyled theme), but then from an enterprise perspective I think classic is usually a better starting point than _styled or _unstyled.
Tony Rad, geändert vor 12 Jahren.

RE: Unable to create a diff theme

Junior Member Beiträge: 29 Beitrittsdatum: 25.02.11 Neueste Beiträge
We was working as David suggested and everything was fine before Liferay 6.1.
With Liferay 6.1 our theme was deployed (we changed the compatibility element value) and we selected it in Page Layout w/o problems.
But the custom.css was simply not loaded and not applied. Our velocity customization, images and js was fine, but the css doesn't.
We turned off the css fast load (http://www.liferay.com/web/igor.spasic/blog/-/blogs/turn-off-minifiers-and-html-stripping) and using Firebug I noticed that in 6.0.5 the custom.css was loaded from the custom theme, instead in 6.1 the custom.css is no more loaded but the main.css is loaded.
So, as soon as we switched back to styled as parent (copying all the classic stuffs and customization under _diffs), everything worked again.
Does anyone know if internally Liferay changed the way of loading the customized css (i.e. no more using custom.css but merging it in main.css)?
Thanks