Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Zeeshan Khan
auto changing of liferay theme for mobiles
April 26, 2012 10:30 PM
Answer

Zeeshan Khan

Rank: Expert

Posts: 349

Join Date: July 20, 2011

Recent Posts

Hi !

I am usin LR 6.0.6. I want to change the theme (default theme = classic) to the iphone theme (or whatever) when the user has navigated to the liferay portal using a mobile device. What i need to do soo that my application detects it automatically and redirect to appropriate theme......???

thnx !
David H Nebinger
RE: auto changing of liferay theme for mobiles
April 27, 2012 8:10 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9269

Join Date: September 1, 2006

Recent Posts

It's handled automagically. Just set up the mobile theme in the settings -> display settings control panel.
David García González
RE: auto changing of liferay theme for mobiles
June 18, 2012 3:21 AM
Answer

David García González

Rank: Regular Member

Posts: 127

Join Date: July 14, 2009

Recent Posts

David H Nebinger:
It's handled automagically. Just set up the mobile theme in the settings -> display settings control panel.

I am trying to test this but It is not working. I am trying it with an iPhone. Perhaps the iphone is not recognized as a WAP device.

Do I have to configure any extra setting in liferay-ext.properties or do I have to try with another device?

Here is a link to a thread where explains the not detection for the iPhone:

http://www.liferay.com/es/community/forums/-/message_boards/message/11970592

Thanks!
Amit Doshi
RE: auto changing of liferay theme for mobiles
June 18, 2012 3:23 AM
Answer

Amit Doshi

Rank: Liferay Master

Posts: 547

Join Date: December 29, 2010

Recent Posts

Hi Zeeshan,

Based on the user Agent you can identify.

$request.getHeader("User-Agent").toString()

Regards,
Amit Doshi
Manish Yadav
RE: auto changing of liferay theme for mobiles
June 24, 2012 5:51 AM
Answer

Manish Yadav

Rank: Expert

Posts: 390

Join Date: May 26, 2012

Recent Posts

might be this post help you for redirection to mobile community Mobile Redirect In Liferay
Sachin Mane
RE: auto changing of liferay theme for mobiles
June 24, 2012 11:06 PM
Answer

Sachin Mane

Rank: Junior Member

Posts: 76

Join Date: April 9, 2012

Recent Posts

I dont think this happens automatically in Liferay version 6.0. In 6.1, it is.

6.1 automatically detects the device type and makes it available for liferay code to use. 6.1 also comes with a wurfl-web plugin which is used to setup rules based on the detected device type. This plugin relies on a wurfl repository available at http://wurfl.sourceforge.net/.

In 6.0, if you just want a perform redirection based on a simple rules, then you can use a filter which will check the user-agent and perform the re-direction.

If you want to alter the theme and layout then you can use ServiePreAction as described in http://www.liferay.com/community/forums/-/message_boards/message/11601895

Or you can add full fledged device recognition and rule setup capabilities similar to 6.1 using ext environment.