I would like to provide another button beside "Save & Close" button on site Page Editor that will trigger save and publish action once pressed. I went to core and made a copy of "Save & Close" button that I'm planning to modify.
I would call this button "Save & Publish", but now I'm kinda curious if I have to modify javascript to include my custom call (let's say javascript:scSave("myPublish:saveAndPublish")
)
I'm following this article to hook into pipeline and complete the action but not sure if that is proper way.
Any advice?
What you need to do is define a custom command in App_Config/Commands.config:
Any custom command needs to subclass Sitecore.Shell.Framework.Commands.Command and override the method
public override void Execute(CommandContext context)
.Use your custom command to call the PublishItem command:
A few things to look for:
scSave("item:publish")
does not work, but calling PublishComand indirectly from a custom command does work. If anyone figures out why this is, please comment!