Custom Field editor button in Experience editor Sitecore 8.X

The experience editor is a wonderful tool that helps the authors to create content fast and effective.

Though, sometimes you stumble across a scenario where you want a certain type of function available to your authors directly in the experience editor, but that function isn’t something that exists out of the box.

This, would be one scenario you could make your own Custom button in the Experience editor. There are two types of custom buttons. There is one for the ribbon (I will make a post about this in the future) and one for the Field editor (this is the one i’ll be going over now).

First, you will switch to your CORE database. Navigate to Custom Experience Buttons (sitecore/content/Applications/WebEdit/Custom Experience Buttons).

custom-experience-buttons
See Item path. Remember this is on the Core db.

Now create an item in this folder(or subfolder), based on the template:
“Field Editor Button” (/System/WebEdit/Field Editor Button).

The Field Editor Button has 4 default fields you are to fill in:

field-editor-button

Header: Showed in the Experience editor option for the rendering.
Icon: Choose an icon to be seen on the field editor ribbon
Fields: This is the tricky part. You must choose the fields you want to show when you click this button. If more than one field you separate them by a pipe. These fields must be in your item template or the dialog will be empty. Think like, what the rendering is supposed to present.
Tooltip: The text when hovering over the button

Now switch back to the Master database and find your sublayout or rendering.
Under Editor Options section you find an Experience Editor Buttons field. Add your custom button and you will now find your button when clicking the rendering in Experience editor.

Experience editor button.png
Field editor custom button.png

Sitecore. Unrecognized Guid format

Have you stumbled across this error message:

RebuildLinkDatabasesIndex|System.FormatException: Unrecognized Guid format.

With/Or this occurring when trying to publish site:

Publish to ‘web’|#Exception:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.AggregateException: One or more exceptions occurred while processing the subscribers to the ‘item:saved’ event.

The reason for me was during an upgrade from Sitecore 7.2 to 8.2 and an upgrade from WFFM 2.4 to 8.2, I got this when trying to run a “publish site” and when trying to “Rebuild Link Database”.

What took me some time to figure out was that it was caused by the WFFM Module. Apparently the example forms created in “/sitecore/system/Modules/Web Forms for Marketers/Sample forms”, had tracking events that didn’t have ids binded to them.

So first make sure you can see standard fields:

Next step:

Have your broken item opened and find the section “Advanced” with its field “Tracking

2016-12-14_15-23-04

If you also take show “Raw values” you can see that there’s an event with no id.

2016-12-14_15-27-01.png

To fix this. Either remove it from raw values or by clicking “Goals” -> “Ok” then “Attributes” -> “Ok”.

This will remove the events that shouldnt exist.

I wish to give credit to Uli Weltersbach, which made a post about this on: Link here.

Please go read his blog. He also gives a way of finding your broken items either by Sitecore Powershell Extension or creating a form page.

Template-specific Placeholder settings in Sitecore

When you start building up a site in Sitecore and you place out renderings from the experience editor it can go really fast from having a single rendering in your add component window to having tons.

Placeholder settings are a great way to restrict what renderings are allowed in a specific placeholder. So even if you have many page types with the same placeholders in them you can specify a template-specific placeholder setting.

Let’s say you have 4 types of pages. They all have a placeholder that contains a rendering of columns. And we want this column rendering available on all those page types.

2016-10-11_15-34-00

The purple border is a page type. It contains a rendering that holds two placeholders. They are named in this context, RightContent and LeftContent.

To restrain the authors from having the option to add all renderings that are available in the global placeholder settings we want to make it template-specific(or pagetype-specific).

We achieve this by adding a new placeholder setting.

The crucial part about this is you need to empty the field Placeholder Key(by default at creation this field will have the value of the item’s name)2016-10-11_16-13-19

In the field below you will set the Allowed Controls to specify what renderings are available for the template-specific placeholder.

Your last step should be on the standard values for the template. Go to Layout Details window and Edit.
Add a new placeholder setting:

2016-10-11_16-22-23

Find your new placeholder setting in the treelist and fill in the “Placeholder Key” field with your placeholder.

Now when you go to the experience editor and add a new component. Only those renderings you set in Allowed Controls should show up for that specific template.

Source of inspiration:

https://community.sitecore.net/technical_blogs/b/maximizing_usability/posts/the-power-of-placeholder-settings