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")
Title.Contains("news")

Filter by News content

Content.Contains("ipsum")
Content.Contains("long established fact")

Filter by Author

Author = "author"
Author != " author"
Author.Contains("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)

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Tags

Was this article helpful?