Run method in Sitecore Command Template will not start

This is my first shot at creating a team template. Basically, I want the command to run when I create a content item based on a specific branch. I tried following the recommendations in Sitecore's “Data Definition Cookbook”, but I just can't get it to work.

Here is what I did (in Sitecore 7.1):

I created a command template as follows:

namespace MyApp.Commands
{
    public class MyCommand : Sitecore.Shell.Framework.Commands.Command
    {
        public override void Execute(Sitecore.Shell.Framework.Commands.CommandContext context)
        {
            // do stuff
        }
    }
}

I registered it as a team in Commands.config as follows:

<command name="mynamespace:mycategory:mycommand" type="MyApp.Commands.MyCommand,MyApp"/>

In Sitecore, I created the MyCommandTemplate command template based on the "/ sitecore / templates / System / Branches / Command Template" template and set the following for the Command field:

mynamespace:mycategory:mycommand(id=$ParentID)

, MyTemplate " __Standard" MyCommandTemplate .

MyTemplate MyBranch "/sitecore/templates/System/Branches/Branch", $name , MyCommandTemplate .

, MyBranch, Execute MyCommand ( , Visual Studio).

- , ?

+4
1

, , , , MyTemplate , .

, , , , - MyTemplate

0

Source: https://habr.com/ru/post/1528818/


All Articles