More in this section

Forums / Developing with Sitefinity / How to include News in site search?

How to include News in site search?

3 posts, 0 answered
  1. MJia
    MJia avatar
    44 posts
    Registered:
    09 Jun 2009
    02 Jun 2010
    Link to this post
    Hi,
    How could we include News (title and description) as part of site search index?  So that when doing a site search, the related News will show up in the result list.

    Thanks.
    Michael
  2. MJia
    MJia avatar
    44 posts
    Registered:
    09 Jun 2009
    02 Jun 2010
    Link to this post
    Okay, I figured out how to add News in the site search index. 
    But here comes other problems:
    - It includes all the News.  Can we just index the News in a specific category?
    - It can only specify one article page, can we use different article page for News in different categories?

    Thanks.
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Jun 2010
    Link to this post
    Hi MJia,

    - It includes all the News.  Can we just index the News in a specific category?

    You have to change the search results and exclude these one that are not related to specific category - This could be done in a custom SearchResults control where you bind the repeater to a custom data source control. As far as I remember we have already discussed how to override the behavior of the default control in another thread.

    The second option is doing this directly in a custom provider where you have to override the base GetContentToIndex() so that you can decide what will be included when your run the index from the backend.

    It can only specify one article page, can we use different article page for News in different categories?

    This will require again a custom provider where you can override GetItemUrl method in your derivate.
    You need to create custom NewsIndexSettingsControl and NewsIndexViewControl where you have to add several selectors - Telerik.Cms.Web.UI.PageIndexUrlWebEditor, Telerik.Cms that will allow you to specify several pages on which you have NewsView controls. When you call Initialize(IDictionary<string, string> settings) of your custom provider you need to get the urls from the settings parameter of the overridden Initialize(IDictionary<string, string> settings)

    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.
Register for webinar
3 posts, 0 answered