Configuring a Document List control's FilterExpression t

Posted by Community Admin on 04-Aug-2018 00:06

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

All Replies

Posted by Community Admin on 08-Mar-2012 00:00

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

Posted by Community Admin on 25-Apr-2012 00:00

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

Posted by Community Admin on 25-Jul-2012 00:00

I'm putting in a ticket on this, I'm stuck as well...tried the same combos

Posted by Community Admin on 27-Jul-2012 00:00

Hey Guys, thank Atanas Valchev for this one :)

Filtering Expression Samples
http://www.sitefinitysteve.com/articles/how-to#Write Advanced Filtering Expressions

Posted by Community Admin on 21-Aug-2015 00:00

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.

Posted by Community Admin on 26-Aug-2015 00:00

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
 

This thread is closed