Gravatar for

Question by Dennis Augustine, May 24, 2015 2:08 PM

Using a server-side function to modify boost value in qre - Sitecore JS UI

How do I pass along a server-side function that I've defined in my main.js as the boosting modifier for a query ranking expression using the JS UI?

1 Reply
Gravatar for

Answer by Jean-François L'Heureux, May 25, 2015 8:40 AM

You can mix server-side ASP.Net with client-side JavaScript.

<script type="text/javascript">
    var qre = '$qre("expression", <%= ComputeBoostingModifier() %>)';

Where the qre variable will exist in client-side JavaScript and the ComputeBoostingModifier() method will exist in your control class or in a <script runat="server"> element in your control markup.

Gravatar for

Comment by Dennis Augustine, Aug 18, 2015 12:10 PM

Thanks you. That was a while ago. It worked out as I recall. :)

Ask a question