Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Content Search Web Part

Posted on 2013-06-11
5
Medium Priority
?
861 Views
Last Modified: 2013-06-18
Hi Experts,

How do I replace a content query web part that displays documents grouped by content type (unavailable in 2013) with a content search web part that will show results that would have been in that content query web part?

CQWP is grouped by subsidiary and filtered by content type.

What do I have to have in place and what do I have to know to be able to remove the content query web parts from the page and replace them?

Thanks in advance, again.
nsy
0
Comment
Question by:nsyyoung
  • 3
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
vaderj earned 1500 total points
ID: 39239694
If I were you I would use powershell.

Use a ForEach  statement for each subsite in a site collection
Use a ForEach statement to look at the contents of each document library in the subsite


use somthing like the following to create a function to delete webparts:
$spweb is the get-spweb object
$URLA/$URLB is just the URL to the list item (page in this case)
This code is from a script i wrote to remove the search box webpart of a new search page


$webpartmanager=$spWeb.GetLimitedWebPartManager("$URLa/$URLb",[System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
$webpart = $webpartmanager.webparts | Where-Object {$_.Title -eq "Search Box"}
$webpartmanager.deletewebpart($webpart)



Use an If statement to find out if the CQWP exists on the page
Use your new function created above to, if the web part exists, remove it, save, checkin, and publish the page.
0
 
LVL 8

Author Comment

by:nsyyoung
ID: 39241218
I got the delete part down - no problem.  What I need is to replace the deleted cqwp with a content search web part that shows the same results as the cqwp did.

But thanks for the powershell guidance.  I have minimal experience with it.
0
 
LVL 9

Expert Comment

by:vaderj
ID: 39241285
So you are looking for a way to add and configure that specific web part via PowerShell, or some other scripted means?
0
 
LVL 8

Author Comment

by:nsyyoung
ID: 39241349
I am open to suggestions, as long as the result in the new web part is the same as in the old web part.
0
 
LVL 8

Author Closing Comment

by:nsyyoung
ID: 39257864
Partial answer, but set me on the right track.  Thanks.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question