Wednesday, May 20, 2009

SAP Portal - Create Custom Layout and Apply the Layout

Create a layout JSP in NetWeaver Developer Studio (NWDS)

mylayout.jsp under the dist/jsp folder

lyt:template
...
/lyt:template

Define component in portalapp.xml

component name="myLayout"
config:
ClassName com.sapportals.portal.pb.layout.PageLayout
ResourceBundleName: pagebuilder_nls
profile:
ComponentType: com.sapportals.portal.layout
com.sap.portal.pcm.Title:
com.sap.portal.pcm.Description:
com.sap.portal.reserved.layout.TagLibLayout : /SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld
com.sap.portal.reserved.layout.TagLibHtmlb: /SERVICE/com.sap.portal.htmlb/taglib/htmlb.tld
com.sap.portal.reserved.layout.TemplateFile: mylayout.jsp
com.sap.portal.reserved.layout.Cont1: the_container_id [title: my container, orientation: vertical]

Deploy the PAR to Portal

Create the layout in Portal Content, actually not necessarily under the Layout Templates.

Set the "Object is a Template" to "Yes"

DONE

2 comments:

David said...

hi...

I've been trying to do this.. but... how from portal 7.0 , can I create a Layout Template from a PAR file?

Tom :L said...

David,

As I said in my original post, you need to code a layout and export it in a PAR, deploy the PAR on portal and then you can create the layout on portal.