0
votes

How do you add a content query webpart to a apublishing page layout and configure it to aggregate content from the pages in the page library??Can some one give me some insight on this?? Do I drop a content query webpart in SP designer?? If I do that, how do I configure the query?? Or do I add a content query webpart using ribbon and then export it and make customizations and import and drop that one on the page layout??? Please someone???

SCENARIO: I have to insert a content query webpart to a publishing page layout for Physicians profile site. Based on the page layout, there will be profile pages for each physicians. Now, each physician's' profile page will have his/her primary practice location name, address, phone etc as well as other multiple practice locations. Say Mr Tom's primary location is listed as hospital 'x' on his profile page, now I want to be able to also aggregate the names of all the other lawyers that also work in hospital 'X' as Tom's office members on his bio page using content query webpart on the page layout. How do I add and configure the webpart? I mean it's easy to add a content query webpart in just one page and configure it but I want to add it on a page layout so all the content pages will have its implementation as the pages are created by the authors.

say there are 10 profile pages in the pages library and 5 of them have at least one of their pracice locations as hopital X(they may be working at hospital Y, Z..etc at the same time too), now I want all 5 doctors name aggregated on the Tom's profile pages as his office members!?

2

2 Answers

0
votes

Lots of question marks... yes you can add the content query webpart to a layout by using SP designer. This will COPY that webpart to every page that is created using that layout (or has its layout switched to that one). That makes the query to set up tricky because it needs to get the input on WHICH physician from somewhere - check out this article here. Using the PageFieldValue option should do the trick.

0
votes

To change a CQWP, don't modify the default version. Instead, navigate to your XSL file in the Style Library in SPD and copy the ItemStyle.XSL and rename the copy to something else (such as CUSTOMItemStyle.xsl). Then go to a test page, place a blank CQWP, and click "Export". Open the .webpart file that you exported and modify the properties to link to your CUSTOMItemStyle.xsl.

Save the .webpart file and import it back to the gallery through the browser. Rename the new CQWP (to something like CUSTOM_CQWP.webpart or whatever).

Now you can modify the CUSTOMItemStyle.xsl to use custom XSL. Shape the XSL file how your requirements dictate, then in your test page, change the Web Part properties to use your new custom ItemSTyle. Once your web part look like you want it to, you can export it again and then reimport it back into the gallery and all your settings will be saved.

Now you can go to Designer and add this web part to your page layouts. When the user uses that layout, the web part is already placed on the page and wired up accordingly. Additionally, by usign this method, they can change teh web part properties of the web part or even delete the web part altogether if they don't want it, without affecting your page layout.

http://msdn.microsoft.com/en-us/library/bb447557(v=office.12).aspx