Sitecore Elements and URLs

We are in the process of transferring multimedia elements (images, PDF files, etc.) from the old system to Sitecore. Some of the directories in the old system have several media elements with the same name but with different extensions. So if I had to get them at the URL, they would be as follows:

  • http://example.com/images/test.gif
  • http://example.com/images/test.jpg

Obviously, they can be achieved on the old file system, as their file extensions vary. In Sitecore, out of the box, this is not the case. Many elements that live under the same node with the same name cannot be achieved by adding extensions in front of them. Only the first media item will be deleted regardless of the extensions.

Is there any way around this? Can Sitecore distinguish between different media objects with the same name, but with different extensions under the same node, so that these two URLs work and point to the corresponding images?

thank

0
source share
2 answers

You can override the media provider or element recognizer in the web.config file.

follow these steps to check:

Check if this element has another element with the same name. If yes, then check the extension. Find the required item of this type based on the extension and return it.

I think this will help you find the right image.

You can link to the link below

http://sitecoreskills.blogspot.co.uk/2014/01/handling-duplicate-media-paths-in.html

+4
source

, Sitecore URL-. , - 0 .

  <!--  MEDIA - USE FILE EXTENSION IN ITEM NAMES
        Indicating whether to include a file extension when generating an item name from a file name.
        Default value: "false"
  -->
  <setting name="Media.IncludeExtensionsInItemNames" value="false" />
+3

Source: https://habr.com/ru/post/1599805/


All Articles