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

Forums / Developing with Sitefinity / Configuring a Document List control's FilterExpression to filter based on custom-classification-based custom field values

Configuring a Document List control's FilterExpression to filter based on custom-classification-based custom field values

6 posts, 0 answered
  1. Trevor
    Trevor avatar
    35 posts
    Registered:
    28 Jan 2012
    08 Mar 2012
    Link to this post
    Using SF 4.3, I have created my own classification on the /Sitefinity/Content/List page.  It is a Hierarchical list called "Products"

    The "name used in code" is "products"

    I then created a custom field at /Sitefinity/Content/Documents, and set it up to work with my Classification.

    I called this field "Product"

    To do this I followed these instructions:
    http://www.sitefinity.com/documentation/documentationarticles/user-guide/website-content/adding-custom-fields-to-content-items/creating-a-new-custom-field 


    Now, according to this page:
    http://www.sitefinity.com/documentation/documentationarticles/user-guide/widgets/content-widgets-group/configuring-the-download-list-widget 

    I should be able to sort my document list by my custom field.

    "To filter the documents and files, in FilterExpression input field, enter the desired filtering expression.
    You can use both default and custom fields. The field supports AND and OR Boolean operators.
    For example, enter Visible = true AND Status = Live 
    "

    I created a "Product" called "Product Name" -- the "name used in code" is "product-name"

    I have set values for the field "Product" to "Product Name" in several documents in my site, but how do I get the Document List to find them with the FilterExpression text input at  Home >ControlDefinition >Views >MasterListView ??

    I have tried the following:

    Visible = true AND Status = Live AND Product = "Product Name"
    Visible = true AND Status = Live AND Product = Product Name
    Visible = true AND Status = Live AND product = "Product Name"
    Visible = true AND Status = Live AND product = Product Name
    Visible = true AND Status = Live AND products = "Product Name" 
    Visible = true AND Status = Live AND products = Product Name 
     

    Visible = true AND Status = Live AND Product = "product-name"
    Visible = true AND Status = Live AND Product =  product-name 
    Visible = true AND Status = Live AND product = "
    product-name"
    Visible = true AND Status = Live AND product = 
    product-name 
    Visible = true AND Status = Live AND products = "
    product-name" 
    Visible = true AND Status = Live AND products = 
    product-name   

    Nothing works -- all I get is "Error parsing the template"

    Is there any up-to-date documentation on how to use this FilterExpression field with a custom field?  All I can find is this: http://www.sitefinity.com/devnet/forums/sitefinity-3-x/developing-with-sitefinity/filterexpression.aspx#685000 

    And that doesn't help me understand how the FilterExpression is able to use custom field names and/or values.

    Thanks in advance for any help.
    -trevor
  2. Jack
    Jack avatar
    23 posts
    Registered:
    03 May 2011
    25 Apr 2012
    Link to this post
    Hi Trevor, have you found a solution to this?
    Im currently trying to do something very similar.. instead of custom classification we are using custom field

    Thanks
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    25 Jul 2012
    Link to this post
    I'm putting in a ticket on this, I'm stuck as well...tried the same combos

  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    27 Jul 2012
    Link to this post
    Hey Guys, thank Atanas Valchev for this one :)

    Filtering Expression Samples
    http://www.sitefinitysteve.com/articles/how-to#Write Advanced Filtering Expressions
  5. Bart Welch
    Bart Welch avatar
    64 posts
    Registered:
    10 Jul 2009
    21 Aug 2015
    Link to this post

    I have a custom module with a field (dropdown list) that contains a list of all of our departments.  within the module view  I'm trying to set the filter to display selected departments.

     I have the filterexpression set to: Visible = true AND Status = Live AND Department.contains ("International Sales")

    This gives me no information when previewed versus listing the appropriate employees.

  6. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    06 Dec 2016
    26 Aug 2015
    Link to this post
    Hi Bart,

    I have just tested the behavior on my side on the latest Sitefinity version (8.1) and was able to filter the dynamic content items by custom choice field value. I added a custom choice field to my dynamic module titled Department and added the following values: Department1, Department2, Department3.

    Then I used the following filter expression in the advanced settings of the dynamic module's widget :

    Visible = true AND Status = Live AND Department.Contains("2")

    As a result, the widget displayed the items which contain 2 in the selected choice field.

    I am also sending attached a short video for your convenience to demonstrate it.

    Regards,
    Sabrie Nedzhip
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
6 posts, 0 answered