Foren

Load theme dynamically based on user session

thumbnail
Rishi Dev Gupta, geändert vor 11 Jahren.

Load theme dynamically based on user session

Expert Beiträge: 255 Beitrittsdatum: 23.11.08 Neueste Beiträge
Hi

I am using Liferay 6.1.2.

I have site which have a set of public pages with default theme, lets call theme-A.

In my theme I have given a drop down which allows a guest user or logged in user to choose one option. This drop down has a list of other 2 available themes say (theme-B and theme-C).

So user can choose different theme as and when he wants from this dropdown. The theme changes are done by site members only and not by admin, thus if there are 2 users on same site same page one user can view the site with theme-A and another user can see the site with theme-B.

The themeId as selected by user will be stored somewhere in session, and have to be applied each time a page is loaded so that it overrides the default liferay behaviour of picking and applying the site theme from database.

How can I do so?

Please help?
Bradley Wood, geändert vor 11 Jahren.

RE: Load theme dynamically based on user session

thumbnail
Sushil Kumar Saini, geändert vor 11 Jahren.

RE: Load theme dynamically based on user session

Regular Member Beiträge: 104 Beitrittsdatum: 27.07.11 Neueste Beiträge
Thanks Bradley,,... nice article ..
thumbnail
Rishi Dev Gupta, geändert vor 11 Jahren.

RE: Load theme dynamically based on user session

Expert Beiträge: 255 Beitrittsdatum: 23.11.08 Neueste Beiträge
Thanks Bradley, It will resolve my approach but as per my needs i need to further customize this so that the value is stored along with user, so that next time after few days when user comes it will see the same scheme as selected during previous visit.

I will be using the expando to further persist the data.