I've been working on a display template to format a timeline.

Right now I'm working on conditional formatting to show icons for each content type shown in the timeline. The conditional works fine as long as I use a value without a space in it like: 'Invoice' but it doesn't work when I use the value 'White Paper'.

<!--#_ if(ContentType == "Invoice") { _#-->
<div class="timeline_card_doc">Invoice</div>
<!--#_ } if(ContentType == "White Paper") { _#-->
<div class="timeline_card_doc">White Paper</div>
<!--#_ } _#-->
  • Try to add "%20" instead of the whitespaces as this is how SharePoint handles spaces. Test using "White%20Paper". Jun 11 '15 at 10:50
  • Replacing the whitespace with "%20" doesn't seem to work, using a content type ID does work but using a content type ID requires modifying the display template for every SharePoint deployment.
    – Yeretho
    Jun 11 '15 at 12:21
  • Try to use "White_x0020_Paper" instead. Jun 11 '15 at 12:25
  • Using "White_x0020_Paper" doesn't work either..
    – Yeretho
    Jun 11 '15 at 12:51
  • My last suggestion would be to try "Whitex0020Paper", then i'm out of ideas. Jun 11 '15 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.