1

I'm working with on-premises SharePoint 2013. I have a library full of training content of various formats, mostly Microsoft Office (pptx, xlsx, docx), as well as some pdfs and video. I created a list, which I defined as a custom content type, with each topic in it, along with links to files in the library that houses the content, as well as a title, a description of the topic, etc.. Since a search can be done on and return only custom content types, I created this list so as to facilitate search returning just the topics of the training, arranged under one link, rather than links to all of the individual files.

Rather than making individual pages for each topic, I'd like to create a results landing page that, when someone clicks on one of the links supplied by search, is populated with the information in the list (title and description of the training topic they clicked on as well as links to the content files).

The question I have is: how do I pass information from the search result list, when clicked on, to that other page? I see there are forms to view lists, but I need to style and display the content, and I don't see how to get there from the built-in forms layout tool. Is there another way?

0

You can think of customizing the display template to achieve this. There are two types of display templates for search results :

  1. Header template
  2. Item template

You need to customize the item display template,of course it needs lot of coding effort (javascript).

How to customize the display template?

  • Go to the search web part setting, check which item template is being used for the search result webpart.

  • Go to the Master page and layout gallery where you will see all display templates available.

For each display template there will be two files 1..js (javascript) 2. html file.

Note :

  • Never touch the javascript file, it automatically gets created.

Download the html version of template file - rename it. Start customizing this file, here we need to write our javascript code.

Notes :

  • We need to write the javascript coding in the html file within the comment section. This looks strange.

  • Upload back the customized html file in the master page and layout gallery and publish it, after that configure it wherever you want to use. :-)

| improve this answer | |

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.