1

I have created custom master page for SharePoint online. I use in my master page some JavaScript, including JQuery. This master page contains Content By Search Web Part (CSWP), and the code for CSWP was generated from snippet tool in design manager. For CSWP I have created custom display template (both control and item). Base on my tests results CSWP results are injected with JavaScript into master page at the end of master page render process. And I have question. Is it possible to reference somehow values from CSWP to master page? CSWP returns some material index which I would like to use in master page code. For example with JQuery.

0

Maybe with AddPostRenderCallback?

More on http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2014/02/13/for-tips-for-using-jquery-with-sharepoint-display-templates.aspx

  • AddPostRenderCallback is used in display template, and I would like to get access from master page to CSWP. So customization in display template will be injected with JavaScript into master page and it's not available to me in master page. I can imagine global variables in display template, but it looks like crazy idea? – Tomasz Szulczewski Dec 17 '15 at 15:32

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.