In the Sitecore 8 for Beginners blog series,I’ll be sharing the knowledge which is basic but yet very important for developers who are learning the Sitecore.
In this blog post I’ll show how we can add our custom button to the Sitecore ribbon.
Later in the series,we will learn to create our custom SPEAK dialog(don’t worry,if you don’t know SPEAK) & bind that dialog to our custom ribbon button.
Before we move forward let’s have a look on the below image to understand these terms:
Ribbon,Tab,Strip & Chunk.
This is well explained by Kiran Patil here:
So after understanding the basics lets see what we will be doing in this blog post:
Looks exciting?Let’s start & login to the Sitecore.
After successfully login,we can see the Sitecore 8 has Windows 8 like icons.Click the desktop icon as shown in the below image.
Since we are adding our custom button to the shell website(the one we just logged in) & most of the settings/configuration related to the Sitecore is defined in core database,lets switch to the Core database.
Click the database icon from the bottom-right of the Sitecore’s Start Menu & select the core.
The default Sitecore ribbon items are defined under
Let’s add a new reference item & name it “My Custom Tab”.
If you noticed our newly created tab item (My Custom Tab) has a field called “Reference”,where we refer the “Strip” item for this tab.
After creating the new tab,it’s time to create the “Strip” for this tab under
This new “Strip” item will have one child item which will refer the “Chunk”.
The Strip item has a field ‘Header’,which is the name shown on the ribbon
The “Chunks” are nothing but the way of separating the ribbon controls(lets call them buttons for now) as per there operation.
To understand it lets see the “Publish” tab in the ribbon.
The “Publish” tab has following chunks as shown in the image:
The display name of the chunks are “Restrictions”,”Publish” & “Social”.
As we can see each chuck has different buttons to perform different actions.
So after understanding the “Chunk” lets creates the one for our Strip under following path:
Every Chunk has some buttons to perform the operation as we saw in the Publish tab’s example.
We need a button under our Chunk which will be used to launch the SPEAK dialog(in later post),so lets creates it(I used “/sitecore/templates/System/Ribbon/Large Button” template & named it “Launch My Dialog”).
Too much exercises? Let’s review what we have done so far:
- We have created the new “Speak” tab here :
- Which refers the Strip item from :
- We have also added a child under this Strip item,which refer our custom Chunk from:
- And finally Our Chunk item has the “Launch My Dialog” button.
Does everything looks fine?Do you see this new custom tab on the ribbon?
You won’t see this newly created tab until you follow below steps:
- Right click on the empty space on the Ribbon.
- Select the “Custom Tab” tab.
Our custom tab should be visible now on the ribbon as follow:
If you can see this new Tab in the ribbon Congratulations you have done it!!!!!!!!!
In next post we will bind our button to launch a dialog(SPEAK dialog).