Question

I'm trying to provisioning a content search web part. I've made a site feature and a standard web part (xml and webpart file).

enter image description here

When I activate the feature I get the web part but it's not a Content by search web part, it's just a normal one. See picture below

enter image description here

How do I turn the normal web part into a CSWP? Link?

Was it helpful?

Solution

<?xml version="1.0" encoding="utf-8"?>
<webParts>
  <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
    <metaData>
      <type name="Microsoft.Office.Server.Search.WebControls.ContentBySearchWebPart, Microsoft.Office.Server.Search, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
    </metaData>
    <data>
      <properties>

I had wrong "type name" .. be sure to have right type name.

Export a cswp and just paste it into the webpart file. Remember to have the

<?xml version="1.0" encoding="utf-8"?>

on top!

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top