#community-help

Issue with Conditionally Displaying HTML in Typesense

TLDR Werner was unable to use HTML conditionally in Typesense. Jason provided support and Werner realized the issue was a coding error.

Powered by Struct AI

1

3
1mo
Solved
Join the chat
Aug 22, 2023 (1 month ago)
Werner
Photo of md5-c3656c1d9a83039876aa12bb0d1e0652
Werner
12:35 PM
conditionally display HTML is working in instantsearch >=v4.46.0 (https://support.algolia.com/hc/en-us/articles/11167544922129-How-do-I-conditionally-display-HTML-in-the-hits-template-).
I could not get it working with Typesense - maybe the adapter is not (yet) prepared for this feature? What I want to do is to 'draw' red and green status LEDs to enrich the visual impression.
Conditionally displaying SVG graphs would be a nice feature in this context.
Thanks for an indication.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:06 PM
The adapter should be agnostic to what you use in the template… Do you see an error when you follow the instructions in that article?
Werner
Photo of md5-c3656c1d9a83039876aa12bb0d1e0652
Werner
05:54 PM
Hi Jason,
it works a described. I had an error in my code, sorry.

1