0

I have custom templates for a ContentBySearchWebPart. I tries to add these templates and a page with ContentBySearchWebPart by module which is implemented into onet.xml. My issue is when the web part is provisioned, the ItemTemplateId and RenderTemplateId properties are set to default values. My settings are ignored. How to solve this issue?

1 Answer 1

0

It appears the tile (~) needs to be xml escaped to be parsed correctly. So:

<property name="ItemTemplateId" type="string">~sitecollection/_catalogs/masterpage/Display Templates/Content Web Parts/Item_TwoLines.js</property>'''

Should become:

<property name="ItemTemplateId" type="string">&#126;sitecollection/_catalogs/masterpage/Display Templates/Content Web Parts/Item_TwoLines.js</property>

As I found on http://www.sharepointnutsandbolts.com/2013/04/provisioning-content-search-web-part.html

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.