代码之家  ›  专栏  ›  技术社区  ›  Adam Hopkinson

Sitecore未解析页面呈现中的富文本编辑器URL

  •  1
  • Adam Hopkinson  · 技术社区  · 16 年前

    在Sitecore 6.1.0中将链接插入富文本时遇到问题。插入指向sitecore项目的链接时,其输出为:

    http://domain/~/link.aspx?_id=8A035DC067A64E2CBBE2662F6DB53BC5&_z=z

    http://domain/path/to/page.aspx

    This article 确认应在渲染管道中解决此问题:

    在Sitecore 6中,它插入一个特殊的 包含Guid的格式化链接 要链接到的项目的,然后 链接将替换为实际链接 到项目

    管道有方法 ShortenLinks 添加到web.config中

    <convertToRuntimeHtml>
        <processor type="Sitecore.Pipelines.ConvertToRuntimeHtml.PrepareHtml, Sitecore.Kernel"/>
        <processor type="Sitecore.Pipelines.ConvertToRuntimeHtml.ShortenLinks, Sitecore.Kernel"/>
        <processor type="Sitecore.Pipelines.ConvertToRuntimeHtml.SetImageSizes, Sitecore.Kernel"/>
        <processor type="Sitecore.Pipelines.ConvertToRuntimeHtml.ConvertWebControls, Sitecore.Kernel"/>
        <processor type="Sitecore.Pipelines.ConvertToRuntimeHtml.FixBullets, Sitecore.Kernel"/>
        <processor type="Sitecore.Pipelines.ConvertToRuntimeHtml.FinalizeHtml, Sitecore.Kernel"/>
    </convertToRuntimeHtml>
    

    谢谢,亚当

    3 回复  |  直到 12 年前
        1
  •  3
  •   Nick Allen    16 年前

    如果使用sc:fld渲染字段值,这将是默认行为。这是Sitecore 5留下的遗留行为,它没有替换项目链接中的GUID。

    如果要使用Sitecore 6的新功能,则必须改用sc:field

        2
  •  3
  •   Julia    16 年前

    如果您正在处理大量的代码更改以实现FieldReNeDER,则可能需要考虑使用SITECOR.Loo.Link KMask.ExpandDynamicLinks(String Text,URLOPTIONS选项)。它解析富文本字段可能包含的媒体项的链接和引用。

        3
  •  0
  •   Bartłomiej Mucha    12 年前

    我也遇到了类似的事情。。我的客户端使用了sitecore占位符,这也不能正确呈现链接。如答案所述,我使用现场渲染结束:

    <sc:FieldRenderer runat="server" ID="frBody" FieldName="Body"/>
    
    推荐文章