Sitecore媒体项目和URL [英] Sitecore Media Items and URLs

查看:106
本文介绍了Sitecore媒体项目和URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在将媒体项目(图像,PDF等)从旧系统迁移到Sitecore.旧系统中的某些目录具有名称相同但扩展名不同的多个媒体项.因此,如果我必须通过URL获取它们,则它们将如下所示-

We are in the process of migrating media items (images, PDFs, etc) from an old system into Sitecore. Some of the directories in the old system have multiple media items with the same name but different extensions. So if I had to get them via URL they would be as follows -

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

显然,在旧的基于文件的系统中可以找到它们,因为它们的文件扩展名不同.在Sitecore中,不是开箱即用的情况.通过在其前面添加扩展名,无法访问以相同名称存在于同一节点下的多个项目.不论扩展名是什么,只有第一个媒体项目都会被选中.

They can obviously be reached in the old file based system because their file extensions differ. In Sitecore, out of the box, this is not the case. Multiple items that live under the same node with the same name cannot be reached by adding extensions in front of them. Only the first media item would be hit regardless of the extensions.

有没有办法解决这个问题? Sitecore可以区分同一节点下具有相同名称但具有不同扩展名的不同媒体项目,以便上述2个URL起作用并指向各自的图像吗?

Is there a way to get around this? Can Sitecore differentiate between different media items with the same name but different extensions under the same node so that the above 2 URLs would work and point to the respective images?

谢谢

推荐答案

您可以在web.config中覆盖媒体提供者或项目解析器.

You can override the media provider or the item resolver in the web.config.

请按照以下步骤进行检查:

follow below steps to check:

检查该项目是否还有另一个具有相同名称的项目 如果是这样,则检查扩展名. 根据扩展名找到该类型的必需项,然后将其返回.

Check if that item has another item with same name If so, then check extension. Find the required item that is of that type based on extension and return that.

我认为它将帮助您找到合适的图像.

I think it will help you to find appropriate image.

您可以参考以下网址

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

这篇关于Sitecore媒体项目和URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆