0

Following are few broken link examples using EditorPage.aspx in Sitecore v8.2. How can an editor create such links and should those be transformed as mentioned in each example scenario. There are too many such links to fix and any ideas to programmatically fix them would be great. Please advice.

Example 1(page):

<p>
<address><strong><a href="EditorPage.aspx?da=core&amp;id=%7B745F287C-B0F5-4C53-AE11-3890136019E3%7D&amp;ed=FIELD503494885&amp;vs&amp;la=es&amp;fld=%7BA2697EB4-4868-471B-B969-7DC4CF9C29C0%7D&amp;so=%2Fsitecore%2Fsystem%2FSettings%2FHtml%20Editor%20Profiles%2FRich%20Text%20UN%20Women&amp;di=0&amp;hdl=H503494925&amp;mo&amp;pe=0&amp;fbd=1#"></a></strong>Foto:&nbsp;<em>Cinthia Sifa Mulanga, "Self-sureness", 2021. T&eacute;cnica mixta sobre lienzo tensado, 84cm x 118cm. </em></address>
</p>

->Can this transformation be the fix in all possible querystring variations of EditorPage.aspx ?: "~link.aspx?745F287C-B0F5-4C53-AE11-3890136019E3&_z=z"

Example 2 (page):

the Egyptian Government has ensured that 55.3% of measures in response to the pandemic are gender-sensitive.<a href="EditorPage.aspx?da=core&amp;id=%7BC57C20CF-290B-4089-8A19-0969D42BD75D%7D&amp;ed=FIELD1890614585&amp;vs&amp;la=en&amp;fld=%7BA2697EB4-4868-471B-B969-7DC4CF9C29C0%7D&amp;so=%2Fsitecore%2Fsystem%2FSettings%2FHtml%20Editor%20Profiles%2FRich%20Text%20UN%20Women&amp;di=0&amp;hdl=H1890614624&amp;mo&amp;pe=0&amp;fbd=1#_ftn1" name="_ftnref1"><sup><span><sup><span>[1]</span></sup></span></sup></a>

->That superscript 1 in the link text, meant for footnote reference 1,has a completely different external website link in the page foot note references. and the id querystring value is pointing to the current page itself which tells me that intended link is not in the id querystring. So, 1st kind of url transformation doesn't sound right to be the broken link fix. Does other query string values help in finding the desired intention of the editors?

1 Answer 1

1
#1:href="~/link.aspx?_id=745F287C-B0F5-4C53-AE11-3890136019E3&amp;_z=z"
#2:href="~/link.aspx?_id=C57C20CF-290B-4089-8A19-0969D42BD75D&amp;_z=z#_ftn1"

Programmatic fix using sitecore powershell extensions:

if ($_.Fields["Description"] -match 'EditorPage.aspx?da=core&amp;id=%7b[\w\d-]{36}%7d.*?"' ){
        $_.Fields["Description"].Value = $_.Fields["Description"].Value -replace '\b((http://[\w-.]*?.unwomen.org/sitecore/shell/Controls/Rich%20Text%20Editor/)|/)?EditorPage.aspx\?da=core&amp;id=%7b([A-Z0-9\-]{36})[^#""]*(#|")' , '~/link.aspx?_id=$3&amp;_z=z$4'
    }

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.