More in this section

Forums / Developing with Sitefinity / Implement Search items by in custom modules

Implement Search items by in custom modules

2 posts, 0 answered
  1. Pierre
    Pierre avatar
    433 posts
    16 Feb 2006
    23 Feb 2009
    Link to this post
    Could you sugest some tips to implement search itemes by.  Used in GC modules at top of NewsItemsList template. I searching to create the searchField selector. Thanks.
  2. Slavo
    Slavo avatar
    295 posts
    24 Sep 2012
    23 Feb 2009
    Link to this post
    Hello Pierre,

    This search in the module administration is actually metadata filtering. If you want to implement such functionality for your custom module, you would have to do two things.

    First, populate the dropdown with the meta keys defined for your module in web.config. Then, when the Search button is clicked, you would have to insert a parameter in the querystring, indicating the filterexpression formed by the search query.

    For example, if you search Generic Content items by Name for "test", the filter expression would look like Param=Name+LIKE+"test". You would have to include this in the querystring using the ParameterKey property of ViewModeControl, and then filter the content you bind to, according to this expression. Just call GetContent method of your manager with the overload having a filterExpression parameter. That's all there is to it.

    If your view is inheriting from ContentItemView, then it would be even easier, as the base provides methods and properties to do this automatically, you would just have to parse the query. Take a look at FilterExpression and NavigateFilterListCommand in ContentItemList.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered