I've tweaked the C# code to extend the description of a page so it shows a bit more text, but the text it displays is from a rich text editor and so the search results are showing the html that goes in this editor. I'm struggling a bit with the syntax for it and wondered if anyone could help?
var displayPreamble = Model.MacroParameters["displayPreamble"].ToString();
I'm guessing I need a StripHtml parameter in there? Or maybe something else.
I don't thik I can use that. There's some funky stuff going on where values are passed from a macro partial to some CS and then to a partial stored in the views folder (I think that's be the correct order) and I'm struggling slightly with how it all fits together. I figured if I could make the data in the variable the stripped html first, then it would get passed through whatever happens as the process goes on.
Maybe it would make a little more sense if I posted a stripped down version below? I've taken out all the other variables and macro parameters to keep it shorter.
If your method would still work - could you point me in the right direction please?
Thanks a lot!
Tom
Macro Partial:
@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var displayPreamble = Model.MacroParameters["displayPreamble"].ToString(); }
@Html.Action("Search", "Simplistic", new { displayPreamble })
No html tags
Hey,
I'm just putting the finishing touches to a search results page using the brilliantly simple package:
https://our.umbraco.org/projects/website-utilities/simplistic-search
I've tweaked the C# code to extend the description of a page so it shows a bit more text, but the text it displays is from a rich text editor and so the search results are showing the html that goes in this editor. I'm struggling a bit with the syntax for it and wondered if anyone could help?
I'm guessing I need a StripHtml parameter in there? Or maybe something else.
Thanks,
Tom
Hi Tom.
Try to see this documentation. https://our.umbraco.org/documentation/Reference/Querying/UmbracoHelper/#StripHtml(stringhtml)
I think that you should be able to do something like this
Hope this helps,
/Dennis
Hi Dennis,
I don't thik I can use that. There's some funky stuff going on where values are passed from a macro partial to some CS and then to a partial stored in the views folder (I think that's be the correct order) and I'm struggling slightly with how it all fits together. I figured if I could make the data in the variable the stripped html first, then it would get passed through whatever happens as the process goes on.
Maybe it would make a little more sense if I posted a stripped down version below? I've taken out all the other variables and macro parameters to keep it shorter.
If your method would still work - could you point me in the right direction please?
Thanks a lot!
Tom
Macro Partial:
Partial:
is working on a reply...