Solved

Content Search Web Part

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Last week I faced a strange issue recently, i have deployed SharePoint 2003 servers for one project and one of the requirements was to open SharePoint site from same server. when i was trying to open site from the same server i was getting authentic…
I recently came across an issue with a MOSS 2007 deployment where access into some sub-sites were denied, even for the MOSS farm administrators. A bit of background to the setup of this MOSS farm; this was a three server setup, consisting of a fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now