Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Phill Ashworth
Theme with custom setting
13 de junio de 2012 5:26
Respuesta

Phill Ashworth

Ranking: New Member

Mensajes: 4

Fecha de incorporación: 6 de junio de 2012

Mensajes recientes

I'm developing a theme with a variation using custom settings as described in the Development Guide.
My 2 themes appear as expected and I can apply either one of them to all the public pages and the setting works correctly as per the example.

 1
 2<theme id="deep-blue" name="Deep Blue">
 3    <settings>
 4        <setting key="header-type" value="detailed" />
 5    </settings>
 6</theme>
 7<theme id="deep-blue-mini" name="Deep Blue Mini">
 8    <settings>
 9        <setting key="header-type" value="brief" />
10    </settings>
11</theme>
12
13#if ($theme.getSetting("header-type") == "detailed")
14    #parse ("$full_templates_path/header_detailed.vm")
15#else
16    #parse ("$full_templates_path/header_brief.vm")
17#end


However if I apply an alternative theme to a single page with "Define a specific look and feel for this page" the page does not display with the specific theme but seems to use the default for the public pages.

Any ideas why the page is not using the specified theme?
Namrata Hangal
RE: Theme with custom setting
13 de junio de 2012 5:35
Respuesta

Namrata Hangal

Ranking: Regular Member

Mensajes: 161

Fecha de incorporación: 26 de julio de 2010

Mensajes recientes

I'm assuming you're using the version 6.1
Not too sure if settings are the same as they were in the earlier versions of Liferay, but can you please check the Manage->Pages option (if it's still there!) and try to select the required theme.

Else, there should be a UI based selection possible - just not sure what they call it in 6.1
Will check and revert

Regards,
Namrata
Phill Ashworth
RE: Theme with custom setting
13 de junio de 2012 7:18
Respuesta

Phill Ashworth

Ranking: New Member

Mensajes: 4

Fecha de incorporación: 6 de junio de 2012

Mensajes recientes

That's right - version 6.1.0

I'm going to Manage -> Page Layout, then I select my page and choose "Look and Feel" and select my theme.
The chosen theme is correctly saved but the view still shows the default theme.
Muzakir Khan
RE: Theme with custom setting
16 de junio de 2012 0:05
Respuesta

Muzakir Khan

Ranking: Regular Member

Mensajes: 112

Fecha de incorporación: 14 de marzo de 2012

Mensajes recientes

Phill Ashworth:
I'm developing a theme with a variation using custom settings as described in the Development Guide.
My 2 themes appear as expected and I can apply either one of them to all the public pages and the setting works correctly as per the example.

 1
 2<theme id="deep-blue" name="Deep Blue">
 3    <settings>
 4        <setting key="header-type" value="detailed" />
 5    </settings>
 6</theme>
 7<theme id="deep-blue-mini" name="Deep Blue Mini">
 8    <settings>
 9        <setting key="header-type" value="brief" />
10    </settings>
11</theme>
12
13#if ($theme.getSetting("header-type") == "detailed")
14    #parse ("$full_templates_path/header_detailed.vm")
15#else
16    #parse ("$full_templates_path/header_brief.vm")
17#end


However if I apply an alternative theme to a single page with "Define a specific look and feel for this page" the page does not display with the specific theme but seems to use the default for the public pages.

Any ideas why the page is not using the specified theme?


Hi!
Plz check out that you are making changes in the portal_normal.vm file that is present in _diffs folder. The correct path for customising portal_normal.vm is "Your Custom Theme -> _diffs -> templates -> portal_normal.vm".., But I think so you are making changes in this wrong path "Your Custom Theme -> templates -> portal_normal.vm.
I have included a sample screenshot of my custom theme's path.. It will give you the idea of exact customising path..

Or else after applying new look and feel, just refresh the page and observe for applied theme changes, it should work... There is no connection between changing look and feel and restarting your server..
Adjunto

archivos adjuntos: Screenshot1.png (30,8k)
S L B
RE: Theme with custom setting
16 de julio de 2012 15:54
Respuesta

S L B

Ranking: New Member

Mensajes: 23

Fecha de incorporación: 28 de julio de 2008

Mensajes recientes

I'm having this same problem with a custom theme created with four variations based on a setting in liferay-look-and-feel.xml on liferay 6.1 too. Whatever I do my pages just keep the default sitewide theme unless I select the Classic theme as the sitewide default and define a specific look and feel for every single page in the site.

Currently I'm planning to debug and step through LayoutImpl.getTheme tomorrow because I don't think our admins want to set the theme for every single page.
S L B
RE: Theme with custom setting
20 de julio de 2012 14:44
Respuesta

S L B

Ranking: New Member

Mensajes: 23

Fecha de incorporación: 28 de julio de 2008

Mensajes recientes

So it's LayoutImpl.getThemeSetting() that returns the wrong value in these circumstances. The Layout doesn't have any value for the custom setting for the custom theme, so the function defaults to the parent LayoutSet's getThemeSetting() method, which in turn eventually calls theme.getSetting(), but for the LayoutSet theme, not the Layout's theme. Which is why it always ends up looking like the default.

I just changed ThemeDisplay.getThemeSetting() to just call theme.getSetting() instead of Layout.getThemeSetting(). It was a lot quicker than fixing Layout.getThemeSetting(). I'd be glad to know why that's a bad idea though.