More in this section

Forums / Developing with Sitefinity / How to remove the Html tags from the content.

How to remove the Html tags from the content.

2 posts, 0 answered
  1. Venkat
    Venkat avatar
    105 posts
    20 Nov 2008
    26 Jan 2009
    Link to this post
    Here we need to show all blogs content even though the user clicks on the search button with out giving search key word.

    But Sitefinity search engine not performing this operation so that I build my custom search .

    Here My problem is to replace the html tags from the content which is showing in the results window.

    Can any one please help me how sitefinity showing the content results.How does it removing the html tags.
  2. Georgi
    Georgi avatar
    3583 posts
    28 Oct 2016
    29 Jan 2009
    Link to this post
    Hello Venkat,

    I am not sure what exactly you mean by replacing the html tags. Do you get these tags in the search results snippets? The snippet is the short description of each search result.

    Perhaps you might do it by creating a custom search results set:
    int count;  
    IList<Telerik.Search.Engine.ResultItem> results = Telerik.Search.Engine.SearchManager.Search(q, "SearchTerm", 0, 10, "AnyWord"out count);  
    if (count == 0)  
         rptResults.Visible = false;  
         rptResults.DataSource = results;  

    Where the SearchTerm is what you have searched for, and the rptResults - the repeater which is showing the results. The result list will be filled with your Search Results items. Each item has the Snippet property you could use. Other than that, the snippets could not be changed or customized, but we will change the individual search result items in our future versions, in order to provide more flexibility and options over the results.

    I hope this helps.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered