The problem: I'm having issues with both the Data View and adding my exported Content Query web part to my master page. The CQWP is giving me an error message that the WebControls:ContentByQueryWebPart isn't cool, and the Data View is not filtering as I expect, and those stupid column headers are killing me. I read somewhere that you shouldn't put CQWP on a master page, but I'm going to do it anyway.
The solution: After piecing together several articles (mostly about SharePoint 2010), I was able to make my content query solution work:
- Create a test page. Add a Content Query web part.
- Configure it to show what you need. Give it a useful name and hide the chrome.
- Export the web part. Save it to the site collection web part gallery.
- Open the master page in SharePoint Designer. (This is where I discovered that you have to hit Code View Tools > Parse HTML to be able to add any web part or code view to your page. Every. Time.)
- Add these to the top of the master page:
<%@Register Tagprefix="Publishing" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> - Insert tab > Web Part > find your exported CQWP > click on it.
- SPD will insert your web part with this tag: <WebControls:ContentByQueryWebPart>. This is what will create the error on your pages. I added Publishing before WebControls in the opening & closing tags: <PublishingWebControls:ContentByQueryWebPart>. All better.
- Save. Publish.
No comments:
Post a Comment