フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Peter Triller
Change the Color Scheme
2011/08/22 0:33
答え

Peter Triller

ランク: New Member

投稿: 4

参加年月日: 2011/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
Ravi Kumar Gupta
RE: Change the Color Scheme
2011/08/22 0:47
答え

Ravi Kumar Gupta

ランク: Liferay Legend

投稿: 1303

参加年月日: 2009/06/23

最近の投稿

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.
Peter Triller
RE: Change the Color Scheme
2011/08/22 1:02
答え

Peter Triller

ランク: New Member

投稿: 4

参加年月日: 2011/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)
Ravi Kumar Gupta
RE: Change the Color Scheme
2011/08/22 1:07
答え

Ravi Kumar Gupta

ランク: Liferay Legend

投稿: 1303

参加年月日: 2009/06/23

最近の投稿

There you go.. Create a Event-hook for ServicePreAction and add that code to it.
Peter Triller
RE: Change the Color Scheme
2011/08/22 10:54
答え

Peter Triller

ランク: New Member

投稿: 4

参加年月日: 2011/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
Peter Triller
RE: Change the Color Scheme
2011/08/23 7:04
答え

Peter Triller

ランク: New Member

投稿: 4

参加年月日: 2011/08/22

最近の投稿

Hi,

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

Thanks for the help



Peter
Sreejith NP
RE: Change the Color Scheme
2013/05/06 21:47
答え

Sreejith NP

ランク: New Member

投稿: 15

参加年月日: 2012/03/13

最近の投稿

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.