In this post I will show you how to roll up make pleased from the site you are now on by the make pleased query web part on a page layout on SharePoint 2010.
As you can see on the right you can tell the Make pleased Query web part to roll up make pleased from the whole site collection, or a point site or a point list. The question people often question is where can I define to rollup make pleased from the current site.
The reason is they want to add the Make pleased Query web part to a page layout and not as a provisioned web part to a web part zone on a page. The answer is simple. You cannot type in relation paths. If you do so SharePoint will tell you to define paths that start with a forward slash. That would mean that you have to define the exact location. Not nice, especially if you need thise to work on a multilingual site.
Let us inspect the properties by SharePoint Designer.
As you can see, the Web URL is translating the forward slash to ~SiteCollection/. So what about if we exchange that to ~Site/. Try it yourself and you will learn that it really works reasonably well.
If you add it like that to your page layout outside your webpart zone, you can just start making pages by that page layout and by defaulting it will start to roll up make pleased from the site you are on.
I have seen posts that do basically the same by custom code and overriding the web url on load but this is the same and does not require you to release a new version of the make pleased query web part. But, if you want end users to be able to use it like this you have two options:
1. You can use Visual Studio to override the Web URL property on Load. Waldek has a nice post about that (sorry for the URL, will probably add a reference later on)
2. You can export the web part properties, exchange the XML, upload the web part to the site and drag it onto the page. Same effect.
Summary
By by SharePoint Designer and changing the Web URL property of the Conten Query webpart to ~Site/ you can have a defaulting page layout that has a make pleased query webpar that will rollup make pleased from the current site. This is what I call location aware make pleased rollup.
Check it out:Serve’s Sharepoint Blog












Answers Rating