2007-05-22

Displaying the same web parts on different pages

EPiServer has a concept of "dynamic properties" that can be used to display certain elements on multiple pages - complete tree of pages - without having to add the same element (web parts, user controls, text) to each and every page. This is not something (at least I've not found it yet) that is a part of SharePoint. Change the properties or content of these common web parts and they should all be propagated to each and every page in the web site (or sub areas of sites).

How can do similar things out-of-the box in SharePoint?

1) Add a "locked" web part zone (set the LockLayout property on the web part zone to true) to the page layout


  • (+) Makes it possible for the site owner to add web parts that cannot be changes by a user
  • (+) Can be used to set banners on each page in the site from a single point
  • (-) SharePoint Designer is the tool to use - cannot be changed from SharePoint directly
  • (-) The same zone and web parts must be added (and later changed) on mutiple page layouts
  • (-) Changes to the Page Layout after a page has been published WILL NOT affect the published page

2) Add the web parts directly to the Page Layout - outside of a web part zone

(+) Makes it possible for the site owner to add web parts that cannot be changes by a user
(+) Can be used to set banners on each page in the site from a single point
(+) Changes will affect all the published with this page layout - Great!!
(-) SharePoint Designer is the tool to use - cannot be changed from SharePoint directly
(-) The same zone and web parts must be added (and later changed) on mutiple page layouts

3) Add web parts directly to the Master Page itself is the most generic way

(+) Makes it possible for the site owner to add web parts that cannot be changes by a user
(+) Can be used to set banners on each page in the site from a single point
(+) Changes will affect all the published pages - Great!!
(-) SharePoint Designer is the tool to use - cannot be changed from SharePoint directly

4) Code a "dynamic properties" feature. How? Don't now yet :-) Ideas?

  • Use "Resuable content"? No, can only be used with html elements, but it may be the first step in the right direction. See theKid's article on reusable content.
  • Picking up and displaying the content of another sharepoint page initialized with the web parts? Yes..., may be a possible solution, but issues concering the use of iframes, masterpages, formating and layout.
  • ...

What I would like in a "perfect solution":

  1. A page where I can define and configure my web parts ("dynamic properties")
  2. A page where I can set in which part of the site/web structure the web parts should be displayed
  3. A clever way of coding and telling that this zone/area is to be filled with my "common" web parts/"dynamic properties"
  4. The solution must also be performant

Any ideas from anybody "out there" on how to solve this challange would be highly appreciated!

1 comment:

Narayanan said...

Hi,

Good blog. I'm following the same approach - Adding web parts directly to the Page Layout - outside of a web part zone. But then what happens in our case, few pages have alerady been created based on the layout. Now when i make changes in the layout and include webparts, it doesn't get added in the existing page. It gets added only in the newly created page. Any idea what should i need to do here ? appreciate any kind of help here.