[jboss-user] [JBoss Portal] - Re: custom portal + css images

JohnnyTheHun do-not-reply at jboss.com
Mon Feb 4 13:46:50 EST 2008


Thanks for the help, after your post, I saw the flaw in my thinking.
Putting the theme into a seperate war was a very good idea, didn't notice that in the reference guide.

Above putting the theme there, I also put my own layout too (and the whole portal for simplicity's sake), and with a bit of myportal-object.xml tweaking I don't have to use the management portlet either.

If it's any help to anyone, my dir structure:

  | mytheme.war
  | + my_styles.css
  | + mylayout.jsp
  | + WEB-INF/
  |    + portal-layouts.xml
  |    + portal-themes.xml
  |    + myportal-object.xml
  |    + web.xml
  |    + jsp/
  |        + <my jsp files>
  | + images/
  |    + mylogo.gif
  |    + myicon.ico
  |    + <lots more images>	
  | <etc...>
  | 

portal-themes.xml:

  | <themes>
  |     <theme>
  |         <name>my_theme</name>
  |         <link rel="stylesheet" id="main_css" href="/my_styles.css" type="text/css"/>
  |         <link rel="shortcut icon" href="/images/favicon.ico"/>
  |     </theme>
  | </themes>
  | 

portal-layouts.xml:

  | <?xml version="1.0" encoding="UTF-8"?>
  | <layouts>
  |    <layout>
  |       <name>my_layout</name>
  |       <uri>/index.jsp</uri>
  |       <uri state="maximized">/index.jsp</uri>
  |       <regions>
  |          <region name="left"/>
  |          <region name="center"/>
  |       </regions>
  |    </layout>   
  | </layouts>
  | 

part of myportal-object.xml:

  | ......
  |       <page>
  |             <page-name>MyPage</page-name>      
  |             <properties>
  |                 <property>
  |                     <name>theme.renderSetId</name>
  |                     <value>divRenderer</value>
  |                 </property>
  |                 <property>
  |                    <name>theme.id</name>
  |                    <value>my_theme</value>
  |                 </property>
  |                 <property>
  |                     <name>layout.id</name>
  |                     <value>my_layout</value>
  |                 </property>
  |                 <property>
  |                     <name>order</name>
  |                     <value>1</value>
  |                 </property>                
  |             </properties>
  |             
  |             <window>
  |              ...
  |              </window>
  |       .......
  |       </page>
  | .....
  | 


And if you by any chance are such a messy coder, that you're using  tags in your layout, then you can reference your images in your .jsp via:

  | <%
  | String contextPath = request.getContextPath();
  | %>
  | ......
  | <img src="<%=contextPath %>/images/yourPic.jpg"/>
  | ......
  | 
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4126317#4126317

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4126317



More information about the jboss-user mailing list