Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sergey B
Issues inheriting from 'classic' theme
February 28, 2012 8:21 PM
Answer

Sergey B

Rank: New Member

Posts: 15

Join Date: November 20, 2011

Recent Posts

Folks,

I am using LR 6.1, was able to customize the styling through the management UI by going to Manage -> Page -> Public Pages -> Look and Feel and adding custom CSS in the entry box at the bottom of the page. Then I attempted to create a simple theme using the same custom CSS, my only new file is custom.css. The theme inherits from 'classic':

1<?xml version="1.0"?>
2<!DOCTYPE project>
3<project name="my-theme" basedir="." default="deploy">
4    <import file="../build-common-theme.xml" />
5    <property name="theme.parent" value="classic" />
6</project>


I ran ant to deploy to my local LR instance:

1ant deploy


After applying the theme through the management UI, the portal ended up having some of the custom.css's styling applied, but the page looks completely distorted. I thought inheriting from 'classic' and including the same CSS that was applied through the management UI would yield the same styling.

Thanks for your help.
Prasanna Raj
RE: Issues inheriting from 'classic' theme
February 29, 2012 7:10 AM
Answer

Prasanna Raj

Rank: Junior Member

Posts: 69

Join Date: January 30, 2012

Recent Posts

Using the Liferay's SDK is the best way to create custom theme. Changing the parent theme to "Classic" is the right way to replicate the classic theme. But I guess, you need to use the SDK to create custom themes.
Also do not forget to build and deploy your theme every time you make any changes to the css or template files.
Sometimes clearing the cache and the temp folder in the tomcat server location will also help display the updates properly. Change in the properties file need restart of the server.
David H Nebinger
RE: Issues inheriting from 'classic' theme
February 29, 2012 7:45 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11111

Join Date: September 1, 2006

Recent Posts

It's clear from his initial post that he is using the SDK. From the build.xml and the ant command...

I think the OP is not aware that changes at the theme level apply to all tags rendered on the page, not just his individual page. The changes are probably not compatible at the portal level...
Sergey B
RE: Issues inheriting from 'classic' theme
February 29, 2012 10:19 AM
Answer

Sergey B

Rank: New Member

Posts: 15

Join Date: November 20, 2011

Recent Posts

Found the root cause. According to my documentation all custom CSS should be placed in custom.css, turns out classic theme's custom.css is full of it's own definitions. The quick hack solution was to copy over classic theme's custom.css and to add my custom CSS at the very bottom of the file. Hope this helps!
David H Nebinger
RE: Issues inheriting from 'classic' theme
February 29, 2012 11:03 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11111

Join Date: September 1, 2006

Recent Posts

Actually you should have extended main.css to include your own custom-ext.css file.

Simplifies migrating your theme to a new Liferay version in the future.
Sergey B
RE: Issues inheriting from 'classic' theme
March 1, 2012 6:04 AM
Answer

Sergey B

Rank: New Member

Posts: 15

Join Date: November 20, 2011

Recent Posts

David,

Great suggestion, thank you for your help. Here's what I ended up putting in _diffs/css:

* custom-ext.css - contains all my custom CSS
* custom.css - copied from the classic theme, no changes necessary. ant does not copy this file from the classic theme, so it must imported manually
* main.css - copied from the classic theme, the only change is:

1@import url(custom-ext.css);