Solved

Content Search Web Part

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
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…

706 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

16 Experts available now in Live!

Get 1:1 Help Now