Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Dieter Engelhardt
Unable to create a diff theme
7. Januar 2012 10:36
Antwort

Dieter Engelhardt

Rang: New Member

Nachrichten: 18

Eintrittsdatum: 30. Oktober 2011

Neue 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

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


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
David H Nebinger
RE: Unable to create a diff theme
7. Januar 2012 11:45
Antwort

David H Nebinger

Community Moderator

Rang: Liferay Legend

Nachrichten: 11770

Eintrittsdatum: 1. September 2006

Neue 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.
Maarten van Heiningen
RE: Unable to create a diff theme
15. Januar 2012 12:06
Antwort

Maarten van Heiningen

Rang: Regular Member

Nachrichten: 173

Eintrittsdatum: 5. Februar 2009

Neue 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
David H Nebinger
RE: Unable to create a diff theme
19. Januar 2012 08:00
Antwort

David H Nebinger

Community Moderator

Rang: Liferay Legend

Nachrichten: 11770

Eintrittsdatum: 1. September 2006

Neue 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
RE: Unable to create a diff theme
8. Februar 2012 13:52
Antwort

Tony Rad

Rang: Junior Member

Nachrichten: 29

Eintrittsdatum: 25. Februar 2011

Neue 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