Sitecore’s component based architecture is the cornerstone of Sitecore’s flexibility as a platform and drives the digital marketing capabilities for personalization and A/B testing. The downside of these components? Developers must become accustomed to working with small discrete blocks of code that represents each component.
To help developers with this task, we have provided a few extensions in Keystone.
Layout details The layout details dialogs have been extended to show the datasource and placeholder on the screen. This allows for a quick glance review of the presentation details without need to dig through multiple dialogs.
The choice is yours to pick your poison – but whether you’ve decided to go with MVC or WebForms, Keystone provides base classes that provide easy access to:
The content block component (available in MVC and WebForms) allows a user or developer to define a set of presentation details that are to be shared. In the following example the content block has a datasource item Footer-MVC.
When the content block loads on the page, the presentation details from that Footer-MVC item will be read and inserted into the page – in this case the mvc.lockedbottom placeholder the holds the content block.
Keystone provides developers with a mechanism to define placeholder settings in the rules engine. When a placeholder is detected on the page, the native Sitecore pipelines will run and read any settings defined in the placeholder settings.
As a second step, Keystone then runs the rules defined in /sitecore/system/Settings/Rules/KeystonePlaceholders, which will act similarly to the rules based “Insert Options.”
The following example demonstrates a situation whenin a user is acting as an administrator and the content block component is added to the list of allowed components.
The execution of the placeholder rules is in addition to the manual placeholder settings. Adding a component with a rule will add it, and removing a component will remove it even if the traditional placeholder setting included the original component.
Rules are executed in the order they are found in the folder. The complete list of available conditions and actions can be seen in the following screen shot.