Filter Expressions

Filter Expressions

Posted on December 17, 2008 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

One of Sitefinity 3.5’s new features is Filter Expressions. These enable you to show content based on conditions, such as publication date, category, and the module’s meta fields. All of the Generic Content Based modules, which include News, Blogs, Events and Images and Documents, support filter expressions.


To access a filter expression, simply drag one of the Generic Content Based modules public controls onto the form, such as a NewsView, click on the advanced tab and then the filter tab. By default, the filter expression filters on a valid publication and expiration date as shown below this sentence:

 
Publication_Date <= "#now" AND Expiration_Date > "#now"

 
You can use filter expressions in a variety of ways and you can combine multiple conditions. For example, you can show all content published before today, with an expiration date that’s valid, where the category is MyCategory and the tag is mytag as shown below this sentence:

 
Publication_Date <= "#now" AND Expiration_Date > "#now" AND Category IN ("MyCategory") AND Tag.Name = "mytag"

 
To filter by specific dates, use this syntax:

 
Event_Start >= "1/1/2008" AND Event_Start < "12/31/2008"

 
Filter Expressions support a variety of SQL operands, joins and conditions. For a full list of them, please review this forum post.

 
You can filter by a variety of fields in the generic content based modules. Using the Events module as an example, you could filter by event start and event end. For a more complete list of fields in the Events Module, please review this article. You could also add and find a list of meta fields by viewing in your Web.config. 
progress-logo

The Progress Team

View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments

Comments are disabled in preview mode.
Topics

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation