You may consider adding a button to the Content Editor’s toolbar and context menu that will start the debugging of the selected item.
Here are the steps:
- Create a new command named Debug under /Content/System/Commands in the core database.
- Fill all necessary fields in the newly created command.
Pay attention to the following ones:
• Click – you can set some arbitrary value here, for example item:debug. • Type – specify namespace.classname,assemblyname here of the class which is shown below:
public class DebugItem : CommandBase
public override bool Execute(Item itemArray)
Context.ClientPage.ClientResponse.Eval("window.open('/?scitemid=" + itemArray.ID.ToString() + "&scdebug=1', '_blank')");
public override CommandStatus QueryStatus(Item itemArray2)
As can be seen, we inherited this class from the CommandBase class. The key method is named Execute where we are opening the selected item in debug mode in new window. The QueryStatus method is obligatory to be overridden.
- Navigate to System/Shell/__Default/Commands and Add “Debug” to the Commands multilist field
That’s all, the command should be present in the context menu. After clicking, you should get the selected item in the debug mode.
Note that the selected item should be present in the web database, otherwise, the home node will be shown upon clicking on the Debug command.