1

I've developed an extended Webpart that inherits from CSWP because we have arround 30 templates each one with many style variations... so that style variations were exposed with webpart probs and the Template parses the values through javascript and it all runs smoothly.

The problem:

The client want's the possibility to run a template on server side through the old method XSLT and i developed a custom xlst and it's rendering alright but all the webpart properties that were parsed in client-side now can't... somehow I need to pass Server properties to my XSLT and i don't know how.

I know that the CQWP add a method to inject Server properties and methods from a class to xslt but i've exhausted every ideas and didn't came out with a solution.

Anyone knows a solution for this ?

  • I have exact the same problem. Did you find a solution for that so far? Thanks for your help. – Pascal Hohensträter Apr 2 '14 at 9:52
0

I found an answer for that and documented it here:

http://www.softforge.ch/Blog/Beitrag/9/Content-Search-Web-part,-pass-custom-parameter-to-XSL-for-server-side-rendering

You have to inherit from the CSWP and override the OnPreRender method.

There in the ControlsCollection you will find the ServerRenderer Control. This Control is used when server-rendering is used :)

As this control inherits from the DataFormWebPart you can than use the normal way via ParameterValues.Set("name","value") to set the values that then can be used in the XSL File.

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.