2
votes

I'm wondering about documentation to create a simple custom ribbon control for sitecore shell.

The problem i'm trying to address is that Admins should be able to force all subitems recursively to be approved to a certain workflow state (rather than approve each one manually), but we currently don't know any way to achieve that.

To solve this, we want to force items throught the workflow state (triggering the corresponding commands) programmatically, but we need a sane way for admins to interact with this, the sensible option would be a custom thingie in sitecore shell, but we aren't sure how easy is to achieve that.

any recommended readings for this problem?

1

1 Answers

2
votes

Though this article claims to be written for Sitecore 5.3, the same steps apply for 6.x as well. Note: it requires access to the SDN: How to create a ribbon button in Sitecore v5.3

The high-level points from the article are:

  1. Create a new class that inherits from Sitecore.Shell.Framework.Commands.Command
  2. Mark the class as [Serializable]. It might not be necessary for simple commands, but add it now so you don't get problems later! Otherwise the button might not work correctly (this is related to pipelines - and the fact that pipelines might be stopped and resumed)
  3. Override Execute() and possibly also GetIcon(), GetHeader(), QueryState(), GetClick(), GetSubmenuItems()
  4. Add a new <command name="…" type="..."> tag to /App_Config/Commands.config file
  5. Log into Sitecore and switch to the core database
  6. Navigate to /sitecore/content/Applications/Content Editor/Ribbons and create (or copy) a command in the desired chunk
  7. Enter your command name (the one from step 4) in the "Click" field (and supply a Header, Icon, Tooltip, etc)