1
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <contentEditor>
            <ribbons>
                <strip id="CustomStrip" title="Custom Strip">
                    <chunks>
                        <chunk id="CustomChunk" title="Custom Chunk">
                            <buttons>
                                <button id="CustomButton" header="Custom Button" click="javascript:alert('Custom Button Clicked');" icon="Applications/32x32/bullet_blue.png" />
                            </buttons>
                        </chunk>
                    </chunks>
                </strip>
            </ribbons>
        </contentEditor>
    </sitecore>
</configuration>

I am writing a plugin for the Content Editor. I placed this code in the App_Config\Include folder and named it Ribbon.config. I want to create custom elements (strip, chunk, button) on the Content Editor toolbar from an ASP.NET project, but I didn't get any result. Am I doing everything correctly?

2 Answers 2

1

You can create strips, chunk and button by navigating to the core database and creating them in below order.

  1. In order to create the strip, you need to navigate to following path /sitecore/content/Applications/Content Editor/Ribbons/Strips and create item with following template /sitecore/templates/System/Ribbon/Strip

enter image description here

  1. Thereafter, you can create the chunk inside following path /sitecore/content/Applications/Content Editor/Ribbons/Chunks with the template /sitecore/templates/System/Ribbon/Chunk

enter image description here

Note: You need to link the chunk created on step2 with the strip created on step1 using the reference field as below.

enter image description here

  1. Add the button inside the chunk created on Step2 with the template /sitecore/templates/System/Ribbon/Large Gallery Button as shown below.

enter image description here

You can follow this guide for more details.

https://community.sitecore.com/community/en?id=community_blog&sys_id=71e267211bc370d0b8954371b24bcbdb

You can sync these changes through any serialization tool such as Sitecore Content Serialization or Unicorn on the file system so that they are available on any environment whenever the sync happens.

Hope this helps!!!

2
  • thank you! SCS & unicorn are exactly what I need for my project. Commented Jun 19 at 3:17
  • Thanks @SergeyMartynov. Glad it helped!!!!...you can use either of them to sync these items on file system. Sitecore content serialization is the latest and recommended one to use for the sync.
    – ckhanna
    Commented Jun 19 at 5:42
1

To create custom Tabs, Strips, Chunksk, Button in Sitecore, you need to create some items from different templates in the core database.

Here are some steps that you need to create those items.

  • Navigate to /sitecore/content/Applications/Content Editor/Ribbons/Chunks and create a new Chunk. The template is at /sitecore/templates/System/Ribbon/Chunk

  • Create your button in the newly created Chunk which is based on the template /sitecore/templates/System/Ribbon/Large Button

  • Navigate to /sitecore/content/Applications/Content Editor/Ribbons/Strips and create your new Strip from the template /sitecore/templates/System/Ribbon/Strip

However you are trying to do this from your ASP.net project, you can start thinking of creating items programmatically in the core database.

Refer to the related links for more reference.

https://www.sitecorefundamentals.com/how-to-add-custom-buttons-to-the-content-editor-ribbon

https://stackoverflow.com/questions/42676754/how-to-add-a-custom-strip-with-a-custom-chunk-and-button-in-sitecore-8-1

Hope this helps.

2
  • thank you! but i need to create this elements from code in asp.net project. Commented Jun 18 at 15:23
  • Updated answer. Commented Jun 18 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.