Try our conversational search powered by Generative AI!

Index block content when used in XhtmlString

Vote:
 

I want the block content to be included in a page's SearchText property when dragged into an XhtmlString property on that page. 

Now the name of the block instance is added to page's SearchText instead of the content of that block instance.

How can I achieve it?

N.B. I am using [IndexInContentAreas] attribute for those blocks that I want to be included in a page's SearchText property when used in ContentAreas and that is working correctly!

#249809
Mar 10, 2021 7:05
Vote:
 

One easy way would be to add a public property to your model then write some code to load the items XHtmlString property and any blocks returning a string of exactly the content. This would then be pushed to find and could be used for the search text.

#249845
Edited, Mar 10, 2021 16:53
Vote:
 
#249846
Mar 10, 2021 16:55
Tomas Hensrud Gulla - Mar 10, 2021 19:57
I use this approach! :-)
Robert Tellvik - Mar 11, 2021 9:47
Thanks!
I tried it out and it works!
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.