SharePoint List Web Part Shared by Sub Sites
Recently I had a requirement where a SharePoint list needs to be available for all sub sites created within a site collection. Consider a scenario where in an organization you have multiple departments having SharePoint sub site for each department and they all want to share an ‘Action Items’ list across all sub sites and main site.
Requirement is as follows:
• ‘Action Items’ list must be available at each sub-site level.
• On the main site when a user log in, user should be able to view Action Items assigned to him.
Solution:
To achieve this we can have a single list created at parent level and the web part of this list can be reused in subsequent sub sites. Thus by doing this we can have all the data stored in the single list, which can be viewed differently in sub site level as per requirement.
• Create a custom web part for that list view, this custom web part supports a tool bar so files can be uploaded and maintained in a single library, but viewed and maintained from any site in the site collection that has this web part.
• Tools needed:
o SharePoint Designer (to make one quick change, export the web part, and then optionally roll back the change)
o Some way to find the site’s GUID
1. Make Web Part of the Action Item list Exportable.
By default any List Web Part is not allowed to be Exported, follow these steps to make it exportable:
• Open the site in SharePoint Designer and double click on a page with the web part (default.aspx, Shared Documents/Forms/Allitems.aspx, etc)
• In the code view find the web part and find
false
and change from “false” to “true”
• Save the page
2. Export the List Web Part
• Go to a browser and visit this page. Go to Site Actions, Edit Page.
• Click Edit in web part you just modified and click Export.
• Give the file a name and save it somewhere where you can find it in the next step.
3. Edit the exported List Web Part Web GUID
Open the .dwp (exported web part) file in SharePoint Designer and replace the Web GUID.
Note : By doing so, where ever this web part is used in the sub site it will always refer to the “Action Items” List and any modification in this list will be available across all sites where this web part is used.
SharePoint uses Globally Unique IDs (GUIDS) to identify just about everything stored in the databases. Notice that the ListName has a GUID, but the WebId is all zeros. Replace the zeros with the GUID for the site that owns the list and all will then work.
all_zeros_guid_here
4. Import the exported settings as a new web part:
Go to the top level site in the site collection and go to Site Actions, Site Settings, and in the Galleries column click Web Parts
5. Add Web Part to the Gallery
Now you can use this web part in all the SubSites, thus you can have a single list which is being used across all sites. This is really helpful when we have SharePoint list whose data has to be shared at different SubSites level.
Requirement is as follows:
• ‘Action Items’ list must be available at each sub-site level.
• On the main site when a user log in, user should be able to view Action Items assigned to him.
Solution:
To achieve this we can have a single list created at parent level and the web part of this list can be reused in subsequent sub sites. Thus by doing this we can have all the data stored in the single list, which can be viewed differently in sub site level as per requirement.
• Create a custom web part for that list view, this custom web part supports a tool bar so files can be uploaded and maintained in a single library, but viewed and maintained from any site in the site collection that has this web part.
• Tools needed:
o SharePoint Designer (to make one quick change, export the web part, and then optionally roll back the change)
o Some way to find the site’s GUID
1. Make Web Part of the Action Item list Exportable.
By default any List Web Part is not allowed to be Exported, follow these steps to make it exportable:
• Open the site in SharePoint Designer and double click on a page with the web part (default.aspx, Shared Documents/Forms/Allitems.aspx, etc)
• In the code view find the web part and find
and change from “false” to “true”
• Save the page
2. Export the List Web Part
• Go to a browser and visit this page. Go to Site Actions, Edit Page.
• Click Edit in web part you just modified and click Export.
• Give the file a name and save it somewhere where you can find it in the next step.
3. Edit the exported List Web Part Web GUID
Open the .dwp (exported web part) file in SharePoint Designer and replace the Web GUID.
Note : By doing so, where ever this web part is used in the sub site it will always refer to the “Action Items” List and any modification in this list will be available across all sites where this web part is used.
SharePoint uses Globally Unique IDs (GUIDS) to identify just about everything stored in the databases. Notice that the ListName has a GUID, but the WebId is all zeros. Replace the zeros with the GUID for the site that owns the list and all will then work.
4. Import the exported settings as a new web part:
Go to the top level site in the site collection and go to Site Actions, Site Settings, and in the Galleries column click Web Parts
5. Add Web Part to the Gallery
Now you can use this web part in all the SubSites, thus you can have a single list which is being used across all sites. This is really helpful when we have SharePoint list whose data has to be shared at different SubSites level.
Comments
Post a Comment