Before upgrading to Sitecore 8.2, our experience editors were able to see help text when hovering over an "Add Here" button in Sitecore. This was helpful because it is not always clear which placeholder you are adding components to, and my client would like that functionality again. Currently the hover text simple says "Add the new component here", I'd like it to say "Add the new component to [Placeholder Name]" Is there a simple settings to turn this on, or does anyone know how to go about changing the functionality to add hover text?
1 Answer
Turns out this was pretty easy - the tooltip is generated in javascript
, in \sitecore\shell\Applications\Page Modes\PlaceholderInsertion.js
on line 48:
addTarget: function (where, chrome, insertPosition) {
var handle = $sc("<div class='scInsertionHandle'></div>").attr("title", this.command.tooltip.replace("{0}", this.placeholder.displayName()));
$sc("<div class='scInsertionHandleLeft scAddToHere'> </div>").appendTo(handle);
$sc("<div class='scInsertionHandleCenter'></div>").append($sc("<span></span>").text(this.command.header)).appendTo(handle);
$sc("<div class='scInsertionHandleRight'></div>").appendTo(handle);
However this.command.tooltip
was returning Add the new component here
rather than Add the new component to {0}
, so the replace was not doing anything.
I just changed the replace to this.command.tooltip.replace("here", "to " + this.placeholder.displayName())
and now it returns a more helpful tooltip.