Filter expressions for content items

Following is a list of examples of filter expressions’ syntax. You can use these examples to create your own filter expressions when you configure the widgets.

Filter by category

Category.Contains("{Taxonomy ID}")
Category.Contains("{Taxonomy ID}") AND Category.Contains("{Taxonomy ID}")(Category.Contains("{Taxonomy ID}") OR Category.Contains("{Taxonomy ID}"))

NOTE: You can view the ID of each classification by adding the Tags widget to a page, clicking its Edit button, deleting the contents of field TaxonomyID, and clicking Save.

Filter by tags

Tags.Contains("{Taxonomy ID}")
(Tags.Contains("{Taxonomy ID}") OR Tags.Contains("{Taxonomy ID}"))

Filter by custom fields (for Number custom field)

CustomFiledName > 0
CustomFiledName = 7

Filter by News title

Title.Contains("News Title")

Filter by News content

Content.Contains("long established fact")

Filter by Author

Author = "author"
Author != " author"

Filter by publication date

PublicationDate <= DateTime.UtcNow // Shows all
PublicationDate < DateTime.UtcNow // Shows all
PublicationDate > DateTime.UtcNow // Shows none

Filter by date logged

To filter only items where the date component of the value specified in the DateLogged field matches the date component of DateTime.UtcNow use:
Visible = true AND Status = Live AND DateLogged.HasValue AND DateLogged.Value.Date = DateTime.UtcNow.Date
To filter events by EventStart and EventEnd dates, for example events that from 1st of January 2014 and end till 4th of January 2014 use:
EventStart > (01/01/2014) AND EventEnd < (04/01/2014)

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.


Was this article helpful?

Next article

NativeChat widget