在 Sitecore 多站点安装上提供 pdf 文档时如何更改图标
我在单个 Sitecore 安装(iis 站点)中运行多个网站。有没有办法在提供 pdf 文档时为每个网站提供不同的 favicon.ico。也许通过覆盖 Sitecore 的 MediaRequestHandler ? 谢谢。
I have multiple web sites running in a single Sitecore installation (iis site). Is there a way I can have different favicon.ico for each websites when serving pdf documents. Maybe by overriding Sitecore's MediaRequestHandler ?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您当前只是将
favicon.ico
文件放入该网站的 wwwroot 中,则该实例上的所有网站都会显示该图标。正如您所指出的,由于提供媒体内容是通过MediaRequestHandler
进行的,因此该处理程序在该 IIS 托管站点的上下文中运行,因此将显示根favicon.ico
。解决内容页面此问题的方法是通过特定布局中的元标记引用网站图标,但我不相信您可以针对媒体项目解决此问题。If you're currently just dropping in a
favicon.ico
file in the wwwroot for the site, that will show that icon for all sites on that instance. Since serving up media content goes through theMediaRequestHandler
as you pointed out, that handler runs in the context on that IIS managed site, and therefore will show the rootfavicon.ico
. The way to fix this for content pages is to reference a favicon via a meta tag in your specific layout, but I don't believe you can get around this for media items.