0

Is there any easy way to use Content Search Web Parts but to be able to use the exact same display template as already defined for search results?

I tried copying the .aspx files (control and list) from _catalogs/masterpage/Display Templates/Search to _catalogs/masterpage/Display Templates/Content Web Parts. This did not work.

(Besides, I do not find any .html files in the _catalogs/masterpage/Display Templates/ folder as many sites suggest there should be.)

  • Try this yeshagrawal.blogspot.com/2013/06/… – Marko Tica Jul 3 '15 at 12:32
  • @eVT Thx for the link, although it only talks about the hover panel, while I was looking for the entire look and feel of the default search results page. I actually solved it by using another web part: Search Results Web Part. This automatically uses the same display format and was a good solution. Answers are still welcome though, for future reference. – Yoh Jul 6 '15 at 19:47
  • Yeah, you can use Search Results Web Part – Marko Tica Jul 7 '15 at 12:40
1

Copying the files to another folder will not do the trick. The display templates get checked for the type of web part they are created. What you need to do is edit the individual display templates (in your case the JS files) and check SearchResults under the Target Control Type (Search).

Target control type

Now the reason why you only have JS display templates and not the HTML versions will be because you do not have the Publishing Infrastucture Featured enabled on your site collection. Once this feature gets enabled, it will provision the HTML display templates to the master page gallery.

  • I actually used another solution as in my comment above: Search Results Web Part. I tried editing the individual templates (forgot to add that in my question) but probably not correctly. If you have any advice on that or an external link, I would still be interested although I don't have the time right now to try things out myself again. – Yoh Aug 5 '15 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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