sitecoresitecore6sitecore-dmspage-editor

encodeNameReplacements not working in page editor


The sitecore configuration code below works well in normal mode.

    <encodeNameReplacements>
      <replace mode="on" find=" " replaceWith="-" />
    </encodeNameReplacements>

In Page editor mode the (Spaces) " " or not replaced with "-".

In Page Editor Mode: If i try to remove image and insert new one; image is not displayed until i saved the page because the (Spaces) " " or not replaced with "-".

enter image description hereenter image description here

Am i missing anything, any ideas will be appreciated.


Solution

  • I had a problem with the encodeNameReplacements messing up the media paths until I found this article.

    After implementing this code in our project a dash will replace the %20 and the media images will still render.

    Sitecore 7.2 Upgrade Media Library Gotcha

    http://getfishtank.ca/blog/sitecore-7-2-upgrade-encoding-media-library-item-names

    While upgrading a client to Sitecore 7.2 this section of the release notes gave us pause:

    Media API

    When rendering media URLs, the system did not use the configuration in the encodeNameReplacements section to replace special characters in the URLs.

    This has been fixed so that media URLs also use the encodeNameReplacements configuration. (323105, 314977)

    Summary:

    media library URLs now use the encodeNameReplacements configuration.