SharePoint 2013 Search Add Managed Property in Item Display Template
Item display template can be modified using Managed Property - We can add or remove the managed property and modify as per requirement.
How to access the Item Display Template , I explained in my earlier post here
Each Search display template contains default managed properties. They appear in the <mso:ManagedPropertyMapping> tag at the top of each template:
Each Template have one-one mapping of property like:-
Take the copies of the templates or modifying existing ones
To add a new managed property, simply add another entry. For example, if I had a managed property named "Country", I would add 'CountryOWSText':'CountryOWSText', to the <mso:ManagedPropertyMapping> tag:
If you have uploading the template to different site - Remember to change the url also.
Use the Managed Property, where you want to change the display the Template like below:-
Save the changes and upload the template in Display Template -> search folder and refer the same file in Search Result Web Part.
Click Ok and publish the page and Search Result web part will start appearing as per our design.
Happy Coding..
Item display template can be modified using Managed Property - We can add or remove the managed property and modify as per requirement.
How to access the Item Display Template , I explained in my earlier post here
Each Search display template contains default managed properties. They appear in the <mso:ManagedPropertyMapping> tag at the top of each template:
Each Template have one-one mapping of property like:-
Take the copies of the templates or modifying existing ones
To add a new managed property, simply add another entry. For example, if I had a managed property named "Country", I would add 'CountryOWSText':'CountryOWSText', to the <mso:ManagedPropertyMapping> tag:
If you have uploading the template to different site - Remember to change the url also.
Use the Managed Property, where you want to change the display the Template like below:-
Save the changes and upload the template in Display Template -> search folder and refer the same file in Search Result Web Part.
Click Ok and publish the page and Search Result web part will start appearing as per our design.
Happy Coding..