Is it possible to use Sitecore specific prompt dialog in Experience Editor, like this below? If so, can somebody provide an example, please?
2 Answers
ExperienceEditor.Dialogs.prompt usually used for this, here an example below for Experience Editor ribbon button:
define(["sitecore", "/-/speak/v1/ExperienceEditor/ExperienceEditor.js"], function (Sitecore, ExperienceEditor) {
Sitecore.Commands.MyCommand =
{
canExecute: function(context) {
return true;
},
execute: function (context) {
ExperienceEditor.Dialogs.prompt("Enter a value:", "Default value", function (newValue) {
ExperienceEditor.Dialogs.alert(newValue);
});
}
};
});
I have used this blog before to create a custom dialog when publishing an item through the experience editor: https://blog.istern.dk/2015/03/02/running-sitecore-field-editor-from-a-speak-command-in-sitecore-experience-editor/