0

I would like to create a sharepoint 2013 solution (.wsp) that could be easily deployed and would contain a basic CSR(JSlink) that would modify all views in the site collection. I have been able to use JSlink when I attached it to webpart, but I have not been able to find out how to change it so it could be attached as a part of a WSP file.

thank you so much for your help.

2 Answers 2

0

If you want to attach a CSR file via JSLink to all existing views, you will have to use a feature event receiver to access the views through code and automate that process.

If you want to attach a CSR file via JSLink to a view that is on some new content that is being deployed as part of the WSP, you can do so via the JSLink element in a view definition.

CAML View element

(JSLink is not mentioned as a child element, but it is usable. If you create a list definition/instance in VS, you will see it.)

1
  • Hi Dylan, thank you for the idea :) My original idea was that WSP would just deploy CSR script to masterpage folder and it would be initialized for all table views. Something like here (solution 1) ranaictiu-technicalblog.blogspot.sk/2013/07/… but it does not seem to work when I deploy it like that,
    – Pedro
    Commented Jan 13, 2016 at 22:14
0

I have found a way. I needed to create a sandboxed solution, then add files to feature and set in XML that javascript has to be deployed in masterpages folder. then just deploy and activate solution and JSlink file will be added into scripts in masterpage code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.