Creating a Custom Page Layout in WPS 7002

I followed these steps to add a custom page layout in the WPS 7002.
  1. Create a folder named CustomLayout under /fs-type1/themes/webspherenotes.firstmodular/layout-templates/ folder
  2. Copy the layout.html and icon.gif from say 1Column folder and copy it to CustomLayout folder after the copy it should look like this
  3. Copy the newly created CustomLayout folder to the /fs-type1/themes/webspherenotes.firstmodular/layout-templates/ in WebDav storage like this
  4. Change the markup of layout.html in the CustomLayout folder to look like this <!-- Entering CustomLayout.layout.html --> <div class="component-container wpthemeCol wpthemeCol-1 ibmDndColumn wpthemeLeft" name="ibmMainContainer"></div> <!-- Entering CustomLayout.layout.html --> I made changes to take out the section that displays hidden widgets on the page and i also did add the HTML comments to show beginning and end of the layout
  5. Then open the /fs-type1/themes/Portal7.0.0.2/system/layouts.json which holds list of layouts that appear in the change layout panel. change it to add one row for newly create CustomLayout like this { 'label':'change_layout_CustomLayout', 'url':ibmCfg.themeConfig.themeWebDAVBaseURI+'layout-templates/CustomLayout/', 'id':'CustomLayout', 'thumbnail':ibmCfg.themeConfig.themeRootURI+'/layout-templates/CustomLayout/icon.gif', 'help':'' }
  6. After make changes copy the layouts.json file to the WebDAV folder
  7. Now try opening the change layout UI and you might not see the newly added CustomLayout in the option, or you might if you do you will see option to switch to CustomLayout like this. If you dont see CustomLayout option go to next step
  8. In my case i was not able to see the option for CustomLayout so i looked in the firebug what is going on and it seems that when i go to Change Layout tab browser makes a request to http://localhost:10039/wps/mycontenthandler/!ut/p/digest!EWsjUKfQQnHqfLpBEXvbog/dav/fs-type1/themes/Portal7.0.0.2/system/layouts.json and the browser was using the cached copy for this file and as a result the changes in the layouts.json were not getting reflected. So i did disable the browser caching using firebug like this
  9. After that when i did refresh the page and i could see the new layouts.json being returned by the server and as a result i could see the change custom layout button

2 comments:

Anonymous said...

Thank you!! I too had to disable my browser cache. I wasted a lot of time trying to figure out why I wasn't seeing my changes until I saw your post.

AAMBER MINDS said...

Great information in this post thanks for sharing...!
website designing