1

How can I provision the search center to my visual studio solution? I have edited my page layout and master page to be able to have the search center in the maincontent of my site collection.

Maby there is a webpart I could just add in my modules element.xml?

Something like following:

  <AllUsersWebPart WebPartZoneID="Left" WebPartOrder="1">
        <![CDATA[
        <webParts>
          <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
           .............
        </webPart>
        </webParts>
        ]]>
  </AllUsersWebPart>

Or is the Search Center in a feature that I could add the feature in my webtemplates onet.xml?

Any kind of help is appreciated alot.

1 Answer 1

2

The Search Center is a dedicate site template, with its dedicated onet / webtemp entries & definition.

You could easily add one to your site collection by creating a subsite with the template SRCHCENTERLITE#0 / SRCHCENTERLITE#1 or SRCHCEN#0.

Alternatively, you could inject the key search webpart within a dedicated page like in your code sample. You'll need the Core Search Result WebPart, Search Query, Search Paging & Search Refinment to mimic what's available in a search center.

3
  • How exacly can add SRCHCEN#0 in my site collection? I added it as my basetemplatename and basetemplateid which is 50. What else?
    – Rohander
    Commented Feb 22, 2013 at 9:29
  • I think Francois meant you could create a Feature Receiver which will automatically create the Search Center when your feature is activated. Keep in mind, it's a completely separate site (as it's a site template), so when you're in a site and you activate this feature, it'll create a new site somewhere, from the Search Centre template.
    – James Love
    Commented Feb 22, 2013 at 11:43
  • Thanks James. My answer was a little bit short on description but indeed, either a feature receiver, or if you are working with publishing site definition, you can add one to your provisioning template. Commented Feb 23, 2013 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.