all things Sitecore related

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.

The ‘case’:
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:
/sitecore/system/Settings/Rules/Insert Options/Rules/

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:
Sitecore Rules Engine: How to create an insert option rule sitecore rules engine insert option rule

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.

Now test the result and create a new folder underneath the Meta-Data folder and check if the Standard Text template is added to the insert options.
Sitecore Rules Engine: How to create an insert option rule sitecore rules engine insert option rule result

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

[youtube]UWYTtDyM3WM[/youtube]

Cheers,
Pieter

Series Navigation<< Sitecore Rules Engine: How to remove conditions and actions

Tags: , , ,

About the Author

About the Author: Pieter is Technical Marketing Manager for Sitecore Netherlands and owner of Gaatverweg.nl. He has more than ten years experience with software developing in multiple programming languages and with different Content Management Systems. Before joining Sitecore Pieter was a lead developer for multiple Sitecore and .Net projects, he joined Sitecore in 2011 as an Solution Architect in The Netherlands, after two years as an Solution Architect he joined the Technical Marketing department. In the role as Techinical Marketing Manager he is responsible for the Global MVP program and the Sitecore technical branding strategy. You can follow Pieter on twitter: @pieterbrink123 or Google+ .

Subscribe

If you enjoyed this article, subscribe now to receive more just like it.

Post a Comment

Your email address will not be published. Required fields are marked *

Top