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

Visible = true AND Status = Live AND Category.Contains("{Taxonomy ID}")

Visible = true AND Status = Live AND Category.Contains("{Taxonomy ID}") AND Category.Contains("{Taxonomy ID}")

Visible = true AND Status = Live AND (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

Visible = true AND Status = Live AND Tags.Contains("{Taxonomy ID}")

Visible = true AND Status = Live AND (Tags.Contains("{Taxonomy ID}") OR Tags.Contains("{Taxonomy ID}") )

Filter by custom fields (for Number custom field)

Visible = true AND Status = Live AND CustomFiledName > 0

Visible = true AND Status = Live AND CustomFiledName = 7

Filter by News title

Visible = true AND Status = Live AND Title.Contains("News Title")

Visible = true AND Status = Live AND Title.Contains("news")

Filter by News content

Visible = true AND Status = Live AND Content.Contains("ipsum")

Visible = true AND Status = Live AND Content.Contains("long established fact")

Filter by Author

Visible = true AND Status = Live AND Author = "author"

Visible = true AND Status = Live AND Author != " author"

Visible = true AND Status = Live AND Author.Contains("author")

Filter by publication date

Visible = true AND Status = Live AND PublicationDate <= DateTime.UtcNow // Shows all

Visible = true AND Status = Live AND PublicationDate < DateTime.UtcNow // Shows all

Visible = true AND Status = Live AND 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:

Visible = true AND Status = Live AND 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.

Was this article helpful?