Extending Sitecore Rule Engine
- Sitecore Rules Engine: How to create a custom condition
- Sitecore Rules Engine: How to remove conditions and actions
- Sitecore Rules Engine: How to create an insert option rule
You can automatically add a insert option using a insert option rule in the Sitecore Rule Engine.
In our Sitecore content tree we have a Meta-Data folder where we store al our meta-data information. The Meta-Data folder is organized in folders which contains meta-data items based on a template called Standard Text. What we want to achieve is that when a new folder is created within the Meta-Data folder the Standard Text template will be automatically available as insert option.
Open the content editor and find the Rules folder:
In the Rules folder create a new Insert Option Rule named Meta-Data rule. For the name enter Meta-Data rule and click, the Rule Set Editor will open. Select the condition Where the parent name compares to value and for the action check Add specific insert option. Specify the rule that it will look like this:
We don’t have to specify or activate the rule for the Meta-Data folder because the insert Option Rules will be automatically processed by the GetInsertRule pipeline.
This article is based on a Webinar (in Dutch) I did about the Site Rules Engine you can see the Webinar on YouTube and read the related post: Sitecore Rules Engine: How to create a custom condition