2

I'm using Sitecore 9.1.1 with SXA 1.8.1.

I have a search results component, I need to render a partial view inside a section in its rendering variant.

I tried to add a Variant component for a custom controller rendering that returns the view. However, it gives me the below error:

enter image description here

I also tried to add a Variant Template and used an NVelocity function (as shown below) that returns an ActionResult.

enter image description here

However the ActionResult is rendered as an object, it's not rendered as HTML.

enter image description here

Is there any other way to render my partial view inside the search results rendering variant?

3
  • Why do need to render a partial view? They are not designed to do that.. What is your actual requirement? If we know that, we might help you with an alternative.
    – Gatogordo
    Mar 26, 2020 at 17:08
  • 1
    And don't use NVelocity.. ;)
    – Gatogordo
    Mar 26, 2020 at 17:08
  • That is the most crazy idea I have ever heard:) I think you need to do a step back an re-think the design of your project. And as @Gatogordo written - don't use NVelocity if you are not force to do it! Mar 26, 2020 at 21:14

0

Your Answer

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

Browse other questions tagged or ask your own question.