Foros de discusión

auto changing of liferay theme for mobiles

thumbnail
Zeeshan Khan, modificado hace 11 años.

auto changing of liferay theme for mobiles

Expert Mensajes: 349 Fecha de incorporación: 21/07/11 Mensajes recientes
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 !
thumbnail
David H Nebinger, modificado hace 11 años.

RE: auto changing of liferay theme for mobiles

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
It's handled automagically. Just set up the mobile theme in the settings -> display settings control panel.
thumbnail
David García González, modificado hace 11 años.

RE: auto changing of liferay theme for mobiles

Regular Member Mensajes: 127 Fecha de incorporación: 14/07/09 Mensajes recientes
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!
thumbnail
Sachin Mane, modificado hace 11 años.

RE: auto changing of liferay theme for mobiles

Junior Member Mensajes: 76 Fecha de incorporación: 10/04/12 Mensajes recientes
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.
thumbnail
Amit Doshi, modificado hace 11 años.

RE: auto changing of liferay theme for mobiles

Liferay Master Mensajes: 550 Fecha de incorporación: 29/12/10 Mensajes recientes
Hi Zeeshan,

Based on the user Agent you can identify.

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

Regards,
Amit Doshi
thumbnail
Manish Yadav, modificado hace 11 años.

RE: auto changing of liferay theme for mobiles

Expert Mensajes: 493 Fecha de incorporación: 26/05/12 Mensajes recientes
might be this post help you for redirection to mobile community Mobile Redirect In Liferay