Using a Theme from ThemeRoller in Portlet

UI Components for JSF
Post Reply
MrButz
Posts: 9
Joined: 16 Mar 2011, 14:09

16 Mar 2011, 14:30

Hi everyone

How can I use a Theme in my Portlet?

The content of the Portlet is written in JSF and Primefaces, the theme is from http://jqueryui.com/themeroller/ and I'm using Pluto.

I tried:

web.xml:

Code: Select all

<!-- use of theme -->
	<context-param>
		<param-name>primefaces.THEME</param-name>
		<param-value>custom-theme</param-value>
	</context-param>
	
	<!-- disable default skin-->
	<context-param>
		<param-name>primefaces.skin</param-name>
		<param-value>none</param-value>
	</context-param>
What is wrong? Did I forget something?

Thank's a lot and have a nice day
Error404 :mrgreen:

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

16 Mar 2011, 14:36

.skin and .THEME is basically the same parameter.
You should disable the default theme with primefaces.THEME = none and should include your own css in the h:head tag
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

MrButz
Posts: 9
Joined: 16 Mar 2011, 14:09

16 Mar 2011, 14:42

This won't work, because it's a Portlet and the <head/> TAG will be obsolete in the HTML.

Code: Select all

<html>
<head>
valid header of the HTML
</head>
<!-- Start of Portlet "code" -->
<head>
invalid header text
</head>
etc.
</html>

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

16 Mar 2011, 14:48

Unfortunately i have no experience with portlets but the primfaces theme is also rendered in the h:head so it should not make any difference.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

MrButz
Posts: 9
Joined: 16 Mar 2011, 14:09

16 Mar 2011, 16:35

It does not work correctly.

I tried to modify the "pluto-default-theme.jsp" file for adding the apprpriate "<link />" line to the html head.
But this is not the write solution, because i had to put there the theme.css file from the themeroller-jar in and not the whole jar file from the ThemeRoller.

Is there any possibility to plug the jar-file from themeroller somewhere into my portlet or my primefaces settings? :?:

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

17 Mar 2011, 12:13

themeroller delivers a .jar? :geek:
ok... the normal primefaces themes works in your portlet?
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

MrButz
Posts: 9
Joined: 16 Mar 2011, 14:09

17 Mar 2011, 12:17

Yes, if I use a <p:themeSwitcher />, the portlet changes it's style.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

17 Mar 2011, 12:18

And themroller delivers a .jar? ;)
If the theme can be changed, you should also have a h:head tag in your .xhtml?
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

MrButz
Posts: 9
Joined: 16 Mar 2011, 14:09

17 Mar 2011, 12:31

ThemeRoller delivers a zip (or tar, don't know), but I have to compile it to a jar for easy maintaining the portlet.
And i don't have a <h:head> in my .xhtml...
This won't work, because it's a Portlet and the <head/> TAG will be obsolete and invalid in the HTML.

Code:
<html>
<head>
valid header of the HTML
</head>
<!-- Start of Portlet "code" -->
<head>
invalid header text
</head>
etc.
</html>
Now, I'm trying to set the theme as the default theme for my portal, don't know if that is the right way...

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

17 Mar 2011, 12:37

I dont know how you can change themes without an head tag in your facelets... because primefaces renders the dependency to its theme in the head tag!
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests