如何通过 Zotonic 之外的 ID 链接到媒体项目?
创意团队希望能够使用 Zotonic 来管理主网站之外使用的图像。为了做到这一点,他们目前链接到图像如下:
<img src="http://example.com/media/inline/2010/10/29/image.jpg" />
这有一个巨大的缺陷。每次在 Zotonic 中替换其中一张图像时,文件名都会发生变化。如果替换发生在不同的日期,则文件的路径会发生变化。这意味着他们必须替换 Zotonic 中的图像,然后更新其他网站上的 HTML。
想象一下,有问题的媒体项目的 ID 为 575。我想让它们链接到图像,如下所示:
<img src="http://example.com/media/575" />
How do you link to a media item by ID Outside Zotonic?
The creative team wants to be able to use Zotonic to manage images used outside of the main website. In order to do this they are currently linking to images as follows:
<img src="http://example.com/media/inline/2010/10/29/image.jpg" />
This has a huge flaw. Every time an one of these images is replaced in Zotonic the filename can change. If the replacement happens on a different day the path to the file changes. This means that they have to replace the image in Zotonic and then update the HTML on the other sites as well.
Imagine that the Media item in question has ID 575. I would like to let them link to images as follows:
<img src="http://example.com/media/575" />
How do you link to a media item by ID outside Zotonic?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
阅读您的问题后,我对
resource_file_readonly
做了一个小更改,并添加了两个 dispath 规则:它允许像这样的图像标签:
此更改现在可以在默认分支(0.6-dev)的提示上使用。
After reading your question I made a small change to the
resource_file_readonly
and added two dispath rules:Which allows an image tag like:
This change is now available on the tip of the default branch (0.6-dev).