2

If I add an internal link in the rich text editor then URL is being created as

<a href="~/link.aspx?_id=326F731D96DA4CAEA1127E0FA48BB9B3&amp;_z=z">

It should be resolved in the correct format with path instead of ID after publishing the page, but it's not happening. I am using a custom link provider, is there any particular method I can check to see why it is happening? I am not able to find it anywhere.

0

2 Answers 2

3

You need to find the <renderField> pipeline and check for this processor.

<processor type="Sitecore.Pipelines.RenderField.ExpandLinks, Sitecore.Kernel" />

You can debug the process method to check the RTE like below.

public virtual void Process(RenderFieldArgs args)
{
    Assert.ArgumentNotNull((object)args, "args");
    if (Context.PageMode.IsExperienceEditorEditing)
    {
        return;
    }

    if (args.FieldTypeKey == "rich text")
    {
         // Write your code
    }
    else
    {
        //Original logic from the default processor
        args.Result.FirstPart = DynamicLink.ExpandLinks(args.Result.LastPart, Settings.Rendering.SiteResolving);
        args.Result.LastPart = DynamicLink.ExpandLinks(args.Result.LastPart, Settings.Rendering.SiteResolving);
    }
}

And you will be able to find it. Refer to this for more help.

Hope this helps.

3

Internal links in Rich text editor are being resolved through below processor inside the renderField pipeline.

<renderField>
  <processor type="Sitecore.Pipelines.RenderField.ExpandLinks, Sitecore.Kernel"/>
</renderField>

This processor utilizes link provider ExpandDynamicLinks method to transform the link inside rich text to the path format. You can check for the method overrides inside your custom provider for this method.

Hope this helps!!! Let me know in case you have any queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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