Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Peter Triller
Change the Color Scheme
22 agosto 2011 0.33
Risposta

Peter Triller

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 22 agosto 2011

Messaggi recenti

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
22 agosto 2011 0.47
Risposta

Ravi Kumar Gupta

Punteggio: Liferay Legend

Messaggi: 1303

Data di Iscrizione: 23 giugno 2009

Messaggi recenti

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
22 agosto 2011 1.02
Risposta

Peter Triller

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 22 agosto 2011

Messaggi recenti

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
22 agosto 2011 1.07
Risposta

Ravi Kumar Gupta

Punteggio: Liferay Legend

Messaggi: 1303

Data di Iscrizione: 23 giugno 2009

Messaggi recenti

There you go.. Create a Event-hook for ServicePreAction and add that code to it.
Peter Triller
RE: Change the Color Scheme
22 agosto 2011 10.54
Risposta

Peter Triller

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 22 agosto 2011

Messaggi recenti

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
23 agosto 2011 7.04
Risposta

Peter Triller

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 22 agosto 2011

Messaggi recenti

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
6 maggio 2013 21.47
Risposta

Sreejith NP

Punteggio: New Member

Messaggi: 15

Data di Iscrizione: 13 marzo 2012

Messaggi recenti

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.