Add presentation details to Sitecore Item Context Menu

Recently I was asked to modify the item context menu that appears in the content editor. The request was to add in a link to the presentation details for that item.

Sitecore stores the context menu configuration in the Core database. The path to this configuration can be found here: /sitecore/content/Applications/Content Editor/Context Menues/Default

If you look at an already configured menu option, you’ll notice that the Message field contains the instruction needed to make “something” happen. For example, here is the instruction for delete: item:delete(id=$Target)

The insert option on the Content Menues folder and the Default folder do not provide you with an option to insert a new “Menu Item”, so you must copy an existing one and modify it for insert from template. See below for the configuration used.

How did you know which command to use?

One way to find this is to simply inspect the anchor in the content editor to see what Sitecore is using. In the below screenshot, Sitecore is invoking the “item:setlayoutdetails” command.

Another way, and a more precise way would be to find the presentation “Details” button configuration.

Where can I find all the out of the box commands?

If you inspect the Sitecore.Kernel.dll with a decompiler such as DotPeek, navigate the Sitecore.Shell.Framework.Commands namespace. They are listed there. You can also find a complete list of commands listed in the …/sitecore/admin/showconfig.aspx result.

About Phil Paris

Hi, my name is Phil Paris and I’m a Sitecore Architect and general Sitecore enthusiast. I’ve been working with Sitecore since 2013. Through this blog I will be sharing Sitecore insights, tips and tricks, best practices and general knowledge with the hopes to further the community at large. Please feel free to reach out to me at any time!

View all posts by Phil Paris →