cancel
Showing results for 
Search instead for 
Did you mean: 

How to change portal theme by code

former_member182374
Active Contributor
0 Kudos

Hello Experts,

I'm using EP 7.31 SP7 and I need to write my own personalization menu.
One of the options should be changing portal theme.

How can I change portal theme for user by code?

Regards,
Omri

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

Hi Omri,

You can achieve this requirement in the following way:

1) Create a portal desktop and add framework page and required theme to it.

2) Repeat the above step for other themes as well. (for n number of themes there must be n number of portal desktops).

3) Create an empty portal role(s)(with invisible property) specific to a single portal desktop.

4) Under Master Rule Collection, add these portal roles and their specific portal desktops.

5) Now, create a portal application or web dynpro java application.

Java application should be able to read the user or group.

On the basis of user/group add the required role(with has required portal desktop) to user/group

Save and commit these UME Changes.

6) Add the above portal application iview to framework page which should be before the masthead( i., it must the first loading iview under framework page).

7) Now, once the user logged into the portal, a corresponding role get's assigned by the java code which in turn calls the master rule collection there by it fetches required portal desktop which has required theme.

😎 This works well and we've tested in our portals.

Regards,

Kamal

former_member182374
Active Contributor
0 Kudos

Thanks Kamal.

I'm building a custom accessibility menu in which user should be able to change theme on the fly (one portal desktop is assigned with different themes is assigned to one user).

I've ended up using a different approach:

I decompiled the personalization portal application and took relevant code from it.

The problem (as always) is to find relevant jars for the (private API) classes...

Regards,

Omri

0 Kudos

Could you share your code please?

former_member182374
Active Contributor
0 Kudos

Hi Julio Alberto Martinez Real,

I can't upload the files to new SCN (although I changed the file extensions...)

How can I send you the files?

Regards,
Omri

0 Kudos

julio-alberto.martinez@soprasteria.com thanks in advance

former_member182374
Active Contributor
0 Kudos

I sent it