1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Are Public Properties of Controls Searchable?

Are Public Properties of Controls Searchable?

8 posts, 1 answered
  1. Jeff
    Jeff avatar
    124 posts
    Registered:
    05 Aug 2007
    02 Jun 2010
    Link to this post
    Hello,

    Imagine I have a page with a LiteralControl in the page's Control collection. Does the search engine index the content in the Text property?

    Taking it one step further, if I add a custom CompositeControl to the page's Control collection, does Sitefinity index the public properties of the control?

    Thanks,
    Jeff
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    02 Jun 2010
    Link to this post
    Hi Jeff,

    The index will get the page HTML and it will not look into the code of your control and the value of its properties.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Jeff
    Jeff avatar
    124 posts
    Registered:
    05 Aug 2007
    02 Jun 2010
    Link to this post
    When you say "get the page HTML," does that mean whatever the controls render will be indexed?

    For example, a LiteralControl will render whatever is contained in its Text property when the Render event is fired. Will Sitefinity index its output?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    03 Jun 2010
    Link to this post
    Hello Jeff,

    The value of the Text property of System.Web.UI.LiteralControl will be added to the index. The HTMLchars are excluded. If you your Text property is "<h1>Hello: " and you search for "Hello" the SearchResults control will return all pages on which you have hello. If you search for <h1>  converted to  ASCII Character Set there should not be results for this query.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Jeff
    Jeff avatar
    124 posts
    Registered:
    05 Aug 2007
    03 Jun 2010
    Link to this post
    Thanks Ivan.

    I understand that the indexer isn't interested in HTML characters but I'm really asking a broader question: When I create a custom control, will Sitefinity index content that is written to the HtmlTextWriter in events such as Render?

    I just want to make sure that what I'm outputting to the page is picked up by the indexer.

    Thanks,
    Jeff
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    03 Jun 2010
    Link to this post
    Hi Jeff,

    The content should be indexed. The LiteralControl that you were referring renders the Text property in Render

    protected internal override void Render(HtmlTextWriter output)
    {
        output.Write(this._text);
    }


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Answered
  7. Jeff
    Jeff avatar
    124 posts
    Registered:
    05 Aug 2007
    03 Jun 2010
    Link to this post
    Thanks. That's what I needed to know.

    I don't plan to utilize Sitefinity's search feature until much further down the road. I just want to make sure that I'm designing controls in a way that the indexer recognizes the output.

    Jeff
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    03 Jun 2010
    Link to this post
    Hi Jeff,

    Ok, let me know if there are any problems.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
8 posts, 1 answered