Solved

Content Search Web Part

Posted on 2013-06-11
5
851 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 8

Accepted Solution

by:
vaderj earned 500 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 8

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 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