1 Reply Latest reply on May 30, 2007 1:37 AM by rharari

    How to put two portlets horizontally(single row) in region.

    ritesh_sanjay

      Hi,
      I need to create page something like that, it should have 3 portlets in center region, one portlet in 1st row and 2 portlets in 2nd row in single region.
      I know, adding portlets vertically in a page is a default feature of JbossPortal.When we add 2 or more than that portlets on same page, it adds in a column.

      But I need to add portlets in a row in the same page .

      I have implemented IPC and need to achieve mentioned above .Could anyone provide me some inputs on the same?

      Thanks!
      Ritesh.

        • 1. Re: How to put two portlets horizontally(single row) in regi
          rharari

          Hi Ritesh,

          If I get your question, you are trying to configure something like this:

          
          +-----------------------+
          | Portlet 1 |
          +-----------------------+
          | Portlet 2 | Portlet 3 |
          +-----------------------+
          
          


          Is that right?
          So you have to create your own layout.
          As a start point, consider analyzing the index.jsp under portal-core.war\layouts\3columns

           <div id="content-container">
           <table>
           <tr>
           <td valign="top">
           <p:region regionName='left' regionID='left'/>
           </td>
           <td valign="top">
           <p:region regionName='center' regionID='center'/>
           </td>
           <td valign="top">
           <p:region regionName='right' regionID='right'/>
           </td>
           <hr class="cleaner"/>
           </div>
          


          The easy way is to duplicate all of this files (index and maximized) into another directory like: portal-core.war\layouts\myLayout
          Then change the index.jsp to achieve your needs:

           <div id="content-container">
           <table>
           <tr>
           <td valign="top" colspan="2">
           <p:region regionName='center' regionID='center'/>
           </td>
           </tr>
           <tr>
           <td valign="top">
           <p:region regionName='left' regionID='left'/>
           </td>
           <td valign="top">
           <p:region regionName='right' regionID='right'/>
           </td>
           </tr>
           <hr class="cleaner"/>
           </div>
          


          Almost finished.
          Now edit this file \jboss-portal.sar\portal-core.war\WEB-INF\portal-layouts.xml and add a declaration for your new layout:

          ....
           <layout>
           <name>myLayout</name>
           <uri>/layouts/myLayout/index.jsp</uri>
           <uri state="maximized">/layouts/myLayout/maximized.jsp</uri>
           <regions>
           <region name="left"/>
           <region name="center"/>
           <region name="right"/>
           <region name="navigation"/>
           </regions>
           </layout>
          ....
          


          Restart jboss and then you can use your new layout with your pages (it will be available in the Layout combobox at admin/management portlet -> theme )

          regards,

          R.Harari