Requirement: I want to replace the file clienttemplates.js found in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS with a custom version. I couldn't find the place where this file is loaded so that I could load my version there. Ideally I could modify the masterpage for it; I don't want to go the path of trying to hook into SP's JavaScript execution stack, I simply want to replace that file for certain sites.

NOTE: I have Minimal Download Strategy activated.

  • 2
    Why would you ever want to replace an OOTB file? Add your own besides the normal one and overwrite what you have to instead – Robert Lindgren Oct 2 '14 at 11:04
  • I'd do this if I'd know where to inject my file to firstly not be loaded before clienttemplates.js and not secondly not too late so that SP's rendering mechanism doesn't pick up the original version before mine is loaded. – Juergen Riemer Oct 2 '14 at 11:53
  • What are you really trying to do? :) – Robert Lindgren Oct 2 '14 at 12:00
  • I have custom JavaScript code which I want to have certain webparts be rendered with. I have multiple webparts on one page. I leverage the templating system (Header,Body,OnPostRender, etc.) for this and hook custom code according to the calling webpart. I want to MDS so the "normal" template overriding doesn't do the trick... I have it already working but I don't want to touch the OOTB file as you also said; that's why I want to replace it (or the function RenderListView). – Juergen Riemer Oct 2 '14 at 12:27
  • Getting JSLink to work with MDS is not really brain surgery – Robert Lindgren Oct 2 '14 at 12:27

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.