1

We recently upgraded from Sitecore 8.1u1 to Sitecore 8.2u2 and noticed that the general link field dialog "InsertLinkViaTreeDialog" has a different structure now. We had a custom field that was populated by the "InsertLinkButtonRuleDefinition" Rule.

But now "InsertLinkButtonRuleDefinition" is missing and I can't figure out how the fields are populated. Can someone help please?

2

Sitecore 8.2u1

Previously InsertLinkButton values were populated with InsertLinkButtonRule (rule item id: {CEDD4633-193B-4D79-8DCC-C49B3C8D0F53}). Where TargetControl of this rule is InsertLinkButton and Trigger click

enter image description here

Action ID is {D4BA15D6-263A-43E6-93DD-CE9E41C7D8E4} and it still exists in Sitecore 8.2u2 (/sitecore/client/Business Component Library/version 1/Layouts/Renderings/Resources/Rule/Rules/Actions/MakeInternalLinkFromTreeView)

So you can use it if you want. I am not sure how your custom field works.

Sitecore 8.2u2

Now there is no InsertLinkButtonRule rule which would populate button values. Instead, values are filled in JS. If you open the InsertLinkButton button definition you will notice that click property (previously empty) now has following value in it:

javascript:app.insertInternalLinkResult()

So you need to find a JS file. When you open PageCode rendering you will notice a path to the JS file.

enter image description here

After you open this file with a text editor you can see that there is an additional function called insertInternalLinkResult.

Code fragment:

  var itemLink = _.template(template, {
    displayText: htmlEncode(targetDisplayTextID.get("text")),
    alternateText: htmlEncode(targetAltTextID.get("text")),
    itemId: targetControlID.get("selectedItemId"),
    queryString: htmlEncode(targetQueryID.get("text")),
    target: targetWindowValue,
    styleClass: htmlEncode(targetStyleID.get("text")),
    path: path,
    anchor: htmlEncode(anchor.get("text"))
  });

  return this.closeDialog(itemLink);

Hope it helps.

p.s.

I used Sitecore Rocks to analyse the dialog structure.

  • Where is this button found? InsertLinkButton. – Filip Jönsson Mar 10 '17 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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