I followed these instructions to add a text field to the internal General Link dialog which works fine.
But now I need a checkbox instead of a text field (anchor) but it still should add a tag with text in the link field like this in raw value view (data-name="teaser_a"):
<link text="Test" data-name="teaser_a" linktype="internal" class="" title="" target="" querystring="" id="{819BFAC1-A563-49DA-9C2C-E88D0B397618}" />
while teaser_a
is the item name, which should automatically be added.
So instead of textbox rendering
I would add a checkbox rendering to /sitecore/client/Applications/Dialogs/InsertLinkViaTreeDialog
layout.
But after that I'm not entirely sure. I'll probably have to update the ReadQueryParamsAndUpdatePlaceholders
method in InsertLinkDialogTreePageCode
class and somehow get the item name.
The code in the example looks like this:
private void ReadQueryParamsAndUpdatePlaceholders()
{
Original implementation
{
this.Anchor.Parameters["Text"] = GetXmlAttributeValue(element, "anchor");
}
}
And than respectively alter the rule in MakeInternalLinkFromTreeView
since it is not a textControl
anymore. Code in example:
... anchor target name to [targetAnchorID,,,textControl6]'s text property ...
I'm new to SPEAK and the rule engine. Can someone point me into the right direction?