Fórum

RE: Setting default theme in portal-ext.properties not working

Kiran Kumar, modificado 13 Anos atrás.

Setting default theme in portal-ext.properties not working

New Member Postagens: 6 Data de Entrada: 19/10/10 Postagens Recentes
I am trying to set the default theme of the portal using the porperty "default.theme.id" in portal-ext.properties, as specified in http://www.liferay.com/community/wiki/-/wiki/Main/How+To+Change+Liferay+Default+Theme. Bu the default theme is still set to classic. But the theme is getting loaded properly and is available for use.

Appreciate any help in this regard.
thumbnail
Maarten van Heiningen, modificado 13 Anos atrás.

RE: Setting default theme in portal-ext.properties not working

Regular Member Postagens: 174 Data de Entrada: 05/02/09 Postagens Recentes
Hi Kiran,

When your theme is deployed on the server you can select the default theme in the control panel in the section of your Display settings of the instance.

In the left nav bar of your controlpanel choose settings of your instance. On the right now choose Display settings and here you will find a dropdown with all loaded theme's available on the server. Choose and save.

Regards,
Maarten
thumbnail
Baptiste Grenier, modificado 13 Anos atrás.

RE: Setting default theme in portal-ext.properties not working

Regular Member Postagens: 100 Data de Entrada: 30/06/09 Postagens Recentes
Try like this:
For a theme with id internal (see the theme's WEB-INF/{liferay-look-and-feel.xml,liferay-plugin-package.properties}), I have to specify the theme in the portal-ext.properties like this:
default.regular.theme.id=internal_WAR_internaltheme


Regards,
Baptiste
thumbnail
Maarten van Heiningen, modificado 13 Anos atrás.

RE: Setting default theme in portal-ext.properties not working

Regular Member Postagens: 174 Data de Entrada: 05/02/09 Postagens Recentes
Hi Baptiste,

This is correct what you discribe. But when you have multiple instances and/or multiple clients/portals on 1 server this will enforce them all to be default set to this specific theme.

The new way for liferay is to use this from the controlpanel and thus giving the instance administrator full controle.

(also this makes the use of the site template functionality much easier.)

Regards,
Maarten
thumbnail
Baptiste Grenier, modificado 13 Anos atrás.

RE: Setting default theme in portal-ext.properties not working

Regular Member Postagens: 100 Data de Entrada: 30/06/09 Postagens Recentes
Hi Maarten,
Yes it's true that I am now aware of a way to do this in a portal-ext.properties.

Regarding the "new way for liferay" I try to avoid to do manual configuration of the portal using the Control Panel, I prefer to automatize configuration using the portal-ext.properties as much as possible. emoticon
If I had to do such a thing I would probably tryo to set the theme porgrammatically from a hook where it is possible to select on which instance/community/... the theme will apply:

// Set custom theme as default for private and public layouts for the Guest community
final Group group = GroupLocalServiceUtil.getGroup(companyId, GroupConstants.GUEST);
LayoutSetLocalServiceUtil.updateLookAndFeel(group.getGroupId(), false, "my_WAR_mytheme", "01", "", false);
LayoutSetLocalServiceUtil.updateLookAndFeel(group.getGroupId(), true, "my_WAR_mytheme", "01", "", false);


Regards,
Baptiste
thumbnail
Maarten van Heiningen, modificado 13 Anos atrás.

RE: Setting default theme in portal-ext.properties not working

Regular Member Postagens: 174 Data de Entrada: 05/02/09 Postagens Recentes
Hi Baptiste,

It's correct that the portal-ext.properties has a more strict way of configurating your portal. But on each change you have to restart and the control panel has a more unified structure.

For things like the themes, download/upload, languages, etc the control panel is much more flexible especialy when you have multiple instances.

However if you have to configure let's say the calender portlet I absolutly conclude with you because not all portlets (especialy the older portlets) can be configured from the controle panel. But this will also change with upcomming releases.
I think the only thing left to set in the portal-ext.properties in the future will be the database connection.

I guess there is no one way to do this, but a multiple ways of getting there emoticon

Regards,
Maarten
thumbnail
Baptiste Grenier, modificado 13 Anos atrás.

RE: Setting default theme in portal-ext.properties not working

Regular Member Postagens: 100 Data de Entrada: 30/06/09 Postagens Recentes
Hi Marteen,
My main concern with customization using in the control panel is that you have to made them manually, and they are not stored in a Source Code Management system ;)

I agree that there are multiple way of getting things done, and I hope that configuring a portal completely from the portal-ext.properties/code will still stay possible, being able to deploy a full working portal pre-configured at you will without having to login and manually do changes seems wonderful to me emoticon
For me it's more a handy way of pre-configuring a portal before deployment than reconfiguring after deployment, especially due to the need of a restart...
For daily maintenance it's sure that the Control Panel is a lot more adapted, but for a pre-deploy customization portal-ext.properties/hook is the way to go.

For now I didn't had to work with multiple-instances portal so... I know that it seems possible to have distinct portal-ext.properties per portal instance but I did not try it.

Cheers,
Baptiste
Kiran Kumar, modificado 13 Anos atrás.

RE: Setting default theme in portal-ext.properties not working

New Member Postagens: 6 Data de Entrada: 19/10/10 Postagens Recentes
Thanks Marteen & Baptiste for the information. I was looking for a way to set the default theme automatically. Setting "default.regular.theme.id" in portal-ext.properties works for me.

Cheers,
Kiran
Kiran Kumar, modificado 13 Anos atrás.

RE: Setting default theme in portal-ext.properties not working

New Member Postagens: 6 Data de Entrada: 19/10/10 Postagens Recentes
In a clean Liferay bundle (which has not been stated even once), I have added a theme in the “deploy” folder of Liferay and the same theme is set as default theme in portal-ext.properties.
When Liferay is started the following errors are observed in console:

Loading file:/C:/work/liferay/test/bundles/tomcat-6.0.26/webapps/default-site-te
mplates-hook/WEB-INF/classes/portal.properties
07:17:26,284 WARN [ThemeLocalServiceImpl:121] No theme found for specified them
e id noir_WAR_noirtheme. Returning the default theme.
07:17:26,284 ERROR [ThemeLocalServiceImpl:145] No theme found for default theme
id noir_WAR_noirtheme. Returning a random theme.
07:17:26,315 WARN [ThemeLocalServiceImpl:121] No theme found for specified them
e id noir_WAR_noirtheme. Returning the default theme.
07:17:26,315 ERROR [ThemeLocalServiceImpl:145] No theme found for default theme
id noir_WAR_noirtheme. Returning a random theme.
07:17:26,331 WARN [ThemeLocalServiceImpl:121] No theme found for specified them
e id noir_WAR_noirtheme. Returning the default theme.
07:17:26,347 ERROR [ThemeLocalServiceImpl:145] No theme found for default theme
id noir_WAR_noirtheme. Returning a random theme.
07:17:26,347 WARN [ThemeLocalServiceImpl:121] No theme found for specified them
e id noir_WAR_noirtheme. Returning the default theme.
07:17:26,347 ERROR [ThemeLocalServiceImpl:145] No theme found for default theme
id noir_WAR_noirtheme. Returning a random theme.

But after the server is started, the default theme is getting set to the one that I mentioned in portal-ext.properties and for any communities or organizations that are created after the portal is started, the default theme is getting set properly. But for the communities (Liferay community) that get created by default, the default theme is not getting set to the one mentioned in portal-ext.properties.
thumbnail
James Min, modificado 13 Anos atrás.

RE: Setting default theme in portal-ext.properties not working

Expert Postagens: 293 Data de Entrada: 14/08/06 Postagens Recentes
It's just not finding that theme, so the ID must be wrong.

look at this wiki article for how the IDs are interpreted:

http://www.liferay.com/community/wiki/-/wiki/Main/Theme+Id+or+Portlet+Id+references+in+portal-ext.properties


If you are tearing your hair out on what the ID of a theme, for example is, go to your DB and look at the LayoutSet table in the themeId column, and you will see what the ID is of a custom theme WAR.