?
Solved

Content Search Web Part

Posted on 2013-06-11
5
Medium Priority
?
858 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

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…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

718 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