掲示板

Change the Color Scheme

12年前 に Peter Triller によって更新されました。

Change the Color Scheme

New Member 投稿: 4 参加年月日: 11/08/22 最新の投稿
Hello,

due to some Branding of the site I am building with liferay, I need to change the used color scheme according to a custom Attribute in the user.

I got this working when I patch the source of Liferay, but I really do not like this approach, and I am not sure I patched the correct position.



How can I implement this functionality using a plugin ?



Any help is appreciated.

Thanks

Peter
thumbnail
12年前 に Ravi Kumar Gupta によって更新されました。

RE: Change the Color Scheme

Liferay Legend 投稿: 1302 参加年月日: 09/06/24 最新の投稿
I guess a JSP-hook(may be for theme or some existing jsps of portal in /Root/html/portal.. not sure though) can help in this case. If I am not wrong, changing a color scheme is just loading another css file. For a user you can store that preference in expando. Later get that value in jsp in hook and render the css you want.

BTW. what is that you modified in source of Liferay.
12年前 に Peter Triller によって更新されました。

RE: Change the Color Scheme

New Member 投稿: 4 参加年月日: 11/08/22 最新の投稿
Hi


I patched com.liferay.portal.events.ServicePreAction,
there is some code that sets the current ColorScheme ,
I just added some overriding code at the end of all
that selection Process.

And selecting a color scheme basically just adds a CSS class to the body tag as far as I know (and internally changes the Image load paths)
thumbnail
12年前 に Ravi Kumar Gupta によって更新されました。

RE: Change the Color Scheme

Liferay Legend 投稿: 1302 参加年月日: 09/06/24 最新の投稿
There you go.. Create a Event-hook for ServicePreAction and add that code to it.
12年前 に Peter Triller によって更新されました。

RE: Change the Color Scheme

New Member 投稿: 4 参加年月日: 11/08/22 最新の投稿
Thats not workink, I had to change the code in the middle of a function, and the code would not work if it was called befoer or after the original ServicePreAction
12年前 に Peter Triller によって更新されました。

RE: Change the Color Scheme

New Member 投稿: 4 参加年月日: 11/08/22 最新の投稿
Hi,

I figured it out. It dod work with the service event hook after a few modifications,

Thanks for the help



Peter
thumbnail
10年前 に Sreejith NP によって更新されました。

RE: Change the Color Scheme

New Member 投稿: 15 参加年月日: 12/03/14 最新の投稿
Dear Peter,
Peter Triller:
Hi,

I figured it out. It dod work with the service event hook after a few modifications,

Peter


could you pl share the modifications done by you?
My requirement is somewhat similar but I would like to give change theme functionality to the public. The changed theme should be applicable for that particular user/guest session.