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.