1

I have already worked with display templates and I have managed to implement a custom search result on another site within the Same Office 365. However, on a recently created site, I am finding a problem with seeing the display templates when editing the search results web part of a new search result page.

Around 3 days ago, I noticed that the 'Sharepoint Server Publishing Infastructure' was not set to active. In fact when uploading the Display template html files, the Javascript file was not being automatically created. I activated the feature, and the Javascript files are now being created, but I still could't see the display template when editing the 'Search results' web part. I waited 2 days, as I recall something I had to turn on for something similar did not take effect immediately, but still, nothing.

Why does it work on one site, but not on the other? What other features could I have missed to turn on? What can I try?

2
  • Is this your root site by any chance i.e. site.sharepoint.com? I have seen various issues with publishing in a root site. Raise a ticket with MS.
    – Bunzab
    Commented Aug 8, 2016 at 10:18
  • @Bunzab Thank you for your comment. Refer to my answer as I have found a solution to the issue. Commented Aug 9, 2016 at 7:18

1 Answer 1

0

Funnily enough, the issue was that I was accessing the: Site Settings / Master Pages from the root site: spname.sharepoint.com/sites/site1.

I was looking around and I unknowingly accessed the Site Settings / Master Pages link from my custom made search result page. Here I noticed how the 'Master Pages' link changes to 'Master Pages and page layouts'. I repeated the usual process from here and concluded that it is indeed in this location that the HTML display templates have to be uploaded and published. Doing so enabled me to use my custom display templates in the search results.

This is probably not a bug but I don't think it actually makes sense. In the first scenario i.e. accessing Site Settings / Master Pages / Display Templates / Search from the root site, there is the option to upload templates for Search results (as one can see in the Path), and hence, this gives a false impression that this is where display templates for search results should be uploaded.

What is strange is that in the main Sharepoint site (different SP site from the above) of the Office 365, accessible at:

spname.sharepoint.com/_layouts/15/start.aspx#/SitePages/Home.aspx,

the 'Site Settings/Master page' is no different if accessed from the root or from the search page. In this scenario I could not have uploaded the display templates into the wrong path.

Furthermore, though I accept that this might be a result of my huge inexperience in Sharepoint, I did not find this documented anywhere and only discovered this 'workaround' after hours of pointless trial and error and ultimately by mistake :).

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.