Skip to content
Home » How to add a button in Content Editor with PowerShell integration

How to add a button in Content Editor with PowerShell integration

Sitecore PowerShell extensions provide the integration in the CMS through visual components. One area for integration is the Ribbon in the Content Editor. Bellow it is shown an example to insert a button in the ribbon.

Create a Sitecore item “Test Application” with the template “PowerShell script module folder in this path /sitecore/system/Modules/PowerShell/Script Library

Create a new item inside named “UI” with the template “PowerShell Script Module”. Check the module activation as it is shown below.

Create the following items using the template “PowerShell Script Module” with names: ContentEditor, Ribbon, Review, My Application. Create a new item named “Option Text” using the template “PowerShell Script”. Bellow the structure and description for each item.

The last item “Option Text” should contain the script body to be executed in the click action. For example, the following script:

# Use the notation "." to get the current directory/item.
$item = Get-Item -Path .
Show-Alert -Title $item.Name

The final step is rebuilding all scripts to get the new button on the CMS. Open the PowerShell ISE> Settings > Rebuild All.

Here is the click action output.

The official documentation is in this link. I hope that is useful for your needs.

1 thought on “How to add a button in Content Editor with PowerShell integration”

  1. Thanks for sharing these instructions, easy to understand and follow. Also, it’s great to have access to the official documentation.

Comments are closed.