Global Office Directory
More Products
Share this page
Home > Community > Technical Blogs > Getting to Know Sitecore > Rules Field Type and Sitecore 6.5
Sitecore 6.5 introduces some great additions to the ruleset editor. One is built-in filtering, so you can quickly find the conditions and actions you are looking for. Another is the ability for the Rules field type to display conditions and actions or just conditions. This post explains how to configure a Rules field to support either option.
Sitecore has a field type named Rules. The user interface Sitecore provides for editing the value of a Rules field is the Rule Set Editor, which is similar to the rule editor available with Microsoft Outlook.
You add a Rules field to your template when you want a content author to be able to specify conditions and the corresponding actions to take if those conditions are met.
There are many cases where both conditions and actions apply. For example, if you're using rules to configure price discounts on products. The condition might be "if the visitor is a first time visitor or if the visitor hasn't been to the site within the last 6 months" and the action might be "discount the price 10%".
But there are also many cases where you only care about the conditions because the actions are implied. An example of this is conditional rendering. The conditions may vary, but the action is always "show content". In these cases, Sitecore would show conditions and actions. A content author could specify actions, even though Sitecore would ignore those actions.
That was how it worked in versions of Sitecore prior to 6.5. With 6.5 you have the ability to hide actions. This is configured using the Source field. Instead of just specifying the path to the rules you want to display you specify 2 parameters using query string notation:
The following screenshot shows the Rule Set Editor with conditions and actions (rulespath=/sitecore/system/Settings/Rules/Notification&hideactions=false):
The following screenshot shows the Rule Set Editor with the actions hidden (rulespath=/sitecore/system/Settings/Rules/Notification&hideactions=true):
Tags: API, UI
Adam is a technical architect on Sitecore's Product Marketing Team. He is responsible for spreading technical knowledge inside and outside of the company, with an emphasis on external systems and applications.
This website is designed to be fully functional with scripts disabled in browser. Please contact the webmaster for any suggestions