3

We have a link like this in the RTE: http://xyzcompany.com/-/media/xyz/PDFs/71-43444_xyz_guide.pdf#page=13?la=en&hash=8993E559F610238AA496E3A5EE4ACD388E231211 when it is rendered out. However, the actual link looks like this in the RTE: http://xyzcompany.com/-/media/xyz/PDFs/71-43444_xyz_guide.pdf#page=13. Sitecore is adding the language and hash values. Is there a .config setting I can change to stop internal PDF links from being rendered with the extra attributes/values or am I going to have to put together a custom MediaProvider to make this functionality happen? I need everything, and including, the "?" to be gone when rendered.

Update: It seems it is an issue with where the Sitecore Link control is inserting anchor tags. It is inserting the anchor tag in front of the query parameter which is causing the anchor to fail. We think the root cause is that we need the Link control to insert anchor tags after the query parameters. Has anyone encountered before or is this considered at this point a Sitecore bug?

1

You should be able to do this by modifying the link manager settings like so to set languageEmbedding="never". You can also set any of the other values if you wish as show below. This is a patch file to make upgrades easier:

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <linkManager>
            <providers>
                <add name="sitecore">
                    <patch:attribute name="lowercaseUrls">true</patch:attribute>
                    <patch:attribute name="addAspxExtension">false</patch:attribute>
                    <patch:attribute name="languageEmbedding">never</patch:attribute>
                    <patch:attribute name="alwaysIncludeServerUrl">true</patch:attribute>
                    <patch:attribute name="useDisplayName">false</patch:attribute>
                </add>
            </providers>
        </linkManager>
    </sitecore>
</configuration>

If this doesn't work you can instead create your own Link provider class and patch this in instead.

1
  • It is to my understanding that this works on URL's but in this case we are concerned with the URL's in the RTE and how to modify those upon creation when the user saves the item after editing. Sounds like we are looking at a custom Media Provider. Jan 20 '17 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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