AI OnAI Off
My current iteration, which permanently changes the target of the link in the softlinkrepo, but the changes are not reflected in the xhtml-field.. IE the old link is still there when I inspect the html in the wysiwyg
var links = repo.Load(contentEventArgs.ContentLink);
foreach(var link in links.Where(p => p.SoftLinkType == ReferenceType.PageLinkReference))
{
if (link.ReferencedContentLink.ID == 3134)
{
var clone = link.ReferencedContentLink.CreateWritableClone();
clone.ID = 241;
link.ReferencedContentLink = clone;
}
}
if (links.Count > 0) repo.Save(contentEventArgs.ContentLink, null, links, false);
Hi.
I am trying to update links in xhtml-content during the SavingContent event using the IContentSoftLinkRepository, but cant seem to get it to work. I have been unable to track down any documentation for it so I have just been playing around, trying and failing. One of my (failed) approaches included below. This one increases the number of softlinks tied to a page, but in the xhtml the link does not change.
Any and all pointers would be appreciated.