I am working on connecting a Sitecore LaunchPad button to a Sitecore Powershell script so I can use the script to perform the desired action. Any examples of how I should do that ?

You can make use of the Large Button template. Please see steps below

  1. Go to the Core database.

  2. Navigate to the path /sitecore/client/Applications/Launchpad/PageSettings/Buttons

  3. Create or select a section where you want the button to appear.

  4. Create a large button based on the template /sitecore/templates/System/Ribbon/Large Button

  5. Fill in the fields.

The main one is the click field. This is where you will insert the click event to trigger the powershell script. Example: item:contextconsole(id=$Target)

Note that on the Launch Pad there will be no text appearing under the Icon because the template Large Button does not contain the field Text which is used to display the label of the icon.

In order to fix this, you can create a template which contain a Text field of type single-line text. Then, the Large button template inherits the newly created template. Once this is done, you can insert a text in the field and this will be shown on the launch pad.

Below is the screenshot of the item in Core database. In this one, I have created the field Text directly on the Large Button template.

enter image description here

Then, on the launch pad, the icon is shown under the Content Editing Section

enter image description here

UPDATE

Based on the test I just performed, when you click on the button, nothing will happen. You will need to use the SPE Web API. Moreover, you will need to add a new field called link and then add your rest api in it. Example: http://hostname/-/script/v2/master/ChildrenAsHtml?item=/sitecore/content&user=admin&password=b

More information about SPE Web Api can be found here:

  • Ouch, having to specify a username/password in clear text on the item link (which the user will be able to see on hover/browser requests tab) seems like a big security risk. – jammykam Mar 15 at 19:09
  • Yes but i haven’t use the spe web api. I think there is a setting in the spe config to configure which user can trigger the api. And since this is in the backoffice, user role can be set on the button. So not all users can have access to it – Hishaam Namooya Mar 15 at 20:53
  • I did give this a try and leverage the code from this stack overflow article stackoverflow.com/questions/40091185/… but in my case I am trying to use the Sitecore Powershell cmdlet Show-ListView and it did not show this dialog box. In the end, I decided to use a Content Editor button instead but I want to continue to look into how this can be done albeit in a different manner. – Carlos Rodriguez Mar 23 at 15:33

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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