0

I want to create a custom display template to be used inside my Content Search WebPart. so i follow the steps inside this link.

where i mainly went to :-

  • site settings >> Web Designer Galleries >> Master Page Gallery >> Display Templete folder >> Content Web Parts folder.

  • i download the Control_List.html file. then rename the copy to Control_ListMY.html.

  • do some modifications to the Control_ListMy.html.
  • upload the Control_ListMy.html.
  • publish the Control_ListMy.html as a major version.

but i am facing these problems:-

  • Inside the Content Web Part folders the related .js was not created automatically.

  • when i add a new Content Search web part the new display template is not showing under the Display Template list :-

enter image description here

so can anyone adivce on these problems please?

1

Check your webtype. For the conversion to be done the publishing infrastructure is needed.

If you need your DisplayTempaltes in a TeamSite or another page without publishing infrastructure, simply upload your Templates to a PublishingSite and download the created .js files.

You could also activate the publishing features, but this will result in a lot of side effects.

  • Yes my current team site does not have publishing infrastructure enabled. I remember in the past i tried enabling this service inside my test team site collection and i got a lot of side effect.So seems even inside my team site collection which have its publishing infrastructure disabled i can not upload custom display templates. so my problem is not really that the .js file was not created automatically but that the custom display template will not appear under "Display Template" list inside my Content Search WebPart if the publishing infrastructure service is disabled! is this correct? – john Gu Sep 28 '16 at 13:31
  • actually no - I am perfectly able to select my uploaded .js displaytemplates in teamsites. Have you checked the TargetControlType? Maybe its not set to your desired webpart. – Mx. Sep 28 '16 at 13:51
  • yes the problem that in my case the custom display templete will not show inside the content Search web part. now i tried the same steps inside a team site which have publishing infrastructure enabled and it worked well.. so not sure if adding a custom display template will work inside a team site that have the publishing infrastructure serivce disabled – john Gu Sep 29 '16 at 11:47
  • as I said - I dont have to enable any features to make my displayTemplates work. – Mx. Sep 29 '16 at 11:48

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.