2

I'm just learning about this JSLink technology and have a simple question.

Does it work on public facing sites because it's not for me. Seems nothing works on public site.

What I've done:

  1. copied a js file from online
  2. uploaded it to my public site master page gallery
  3. tried to set content type to "javascript display template" but that didn't work (surprise)
  4. pointed the web part jslink property to the file and
  5. zippo. nothing happened.

Thanks

user32248
  • 21
  • 1

1 Answers1

4

Client Side Rendering (CSR) that was introduced in SharePoint 2013 should work the same way no matter is it a public site or a private site collection. The below figure demonstrates the customized List View for a Blogs public site.

How to apply the changes

Let's say we need to customizes Blog list view in order to display Read more links for a public site.

  1. Create a rendering template, lets name it Blogs.js You could grab it from here
  2. Upload JavaScript file into Site Assets library
  3. Open Blog home page in Edit mode (Edit page). Specify for Posts web part JS Link property:

    ~sitecollection/SiteAssets/Blogs.js
    

    enter image description here

That's it.

Result

enter image description here

Vadim Gremyachev
  • 42,498
  • 3
  • 86
  • 167