Is it possible to add a web part on every page of a subsite automatically? Can the web part use the same config as the other pages it is one?


With custom code you could iterate over all the (sub)sites and pages and add it programmatic. Some handy work is needed. In this option you can set all the properties you want when adding the webpart to a page. Each page has is own unique config settings.

An other option is to add the webpart to the masterpage. Each page using the edited masterpage would show the webpart. Adding a webpart to a masterpage can be tricky (I haven't done it myself, and I don't know how the settings are stored/set in this scenario).

  • 1
    Please note that with 1st approach you have to support automatic addition of the webpart to all newly created pages (item receiver?); with 2nd approach you will lost personalization support of static web parts (they'll behave as web controls) – Ivan Padabed Oct 10 '11 at 13:16
  • @IvanPadabed Good points! – Dribbel Oct 10 '11 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.