Plone - 在页面中何处存储图像和文件附件的最佳实践?
我们正在使用 Plone 4.1.3 构建一个 Intranet 网站,并想知道是否有 Plone 最佳实践来存储附加到页面的文件和图像。我们的内联网更像是一个协作站点,用户可以在其中发布新闻项目和其他文章。因此,用户将插入图像(使用 TinyMCE 的插入/编辑图像)并将文件附加到页面。
问题:我们应该要求用户将图片和文件上传到哪里?我们是否应该让用户将图像和文件上传到与页面本身相同的文件夹中?或者我们应该在与页面相同的文件夹内创建一个子文件夹,例如 _images 和 _files,并将图像和文件分别上传到 _images 和 _files 文件夹。或者我们应该在页面的父文件夹之外创建一个通用的顶级文件夹,并让用户将文件和图像上传到此顶级文件夹(可能是此顶级文件夹内的 _images 和 _files 子文件夹)。例如,如果我们的网站上有三个顶级文件夹:新闻、财务和工程 - 然后我们还有另一个顶级文件夹,称为“上传”。用户将在新闻中创建页面,当他们使用 TinyMCE 在页面中插入图像时,他们将上传到顶级文件夹 Uploads,而不是上传到与页面相同的文件夹。
将图像和文件存储在与页面相同的文件夹或页面文件夹内的子文件夹中的第一种方法的问题是图像和文件将分散在各处。
第二种方法的问题是创建一个顶级文件夹只是为了存储所有上传的图像和文件,它似乎不是 Plone 的做事方式 - 将与页面相关的所有内容都保存在与页面相同的文件夹中页面或同一父文件夹。
在页面中插入图像(通过 TinyMCE 插入/编辑图像按钮)和文件链接时,是否有关于将图像和文件上传到何处的 Plone 最佳实践?什么是克隆方式?
有什么想法吗?
非常感谢您的期待。
We are building an Intranet website using Plone 4.1.3 and would like to know if there is a Plone best practice on storing the files and images that are attached to pages. Our Intranet is more of a collaborative site where users can post News item and other articles. So users will be inserting images (using TinyMCE's insert/edit Image) and attaching files to pages.
Question: where should we ask the users to upload the images and files to? Should we let users upload images and files to the same folder as the page itself? Or should we create a subfolders inside the same folder as the page, called, say, _images and _files, and upload images and files to the _images and _files folders respectively. Or should we create a common top-level folder outside of the parent folder of the page and have our users upload files and images to this top-level folder (maybe to _images and _files subfolders inside this top-level folder). For example, if we have three top-level folders on our Site: News, Finance and Engineering -- and then we have another top-level folder call say Uploads. Users will create pages in say News and when they insert an image in the page using TinyMCE, they will upload to the top-level folder Uploads instead of to the same folder as the page.
The problem with the first approach of storing images and files in the same folder as the page or in a subfolder inside the page folder is that the images and files will be scattered all over the place.
The problem with the second approach of having a top-level folder created just to store all the uploaded images and files is that it does not appear to be the Plone way of doing things - keeping everything related to the page inside the same folder as the page or same parent folder.
Is there a Plone best practice on where upload the images and files to when inserting images (via TinyMCE insert/edit Image button) and file links in a page? What is the Plone way?
Any thoughts?
Thank you very much in anticipation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在我帮助建立的 150 多个 Plone 站点中,我想说绝大多数最终都使用了中央“Images”文件夹。这可能不适用于非常大的网站,但我认为这对于许多网站来说至少是一个“相当好的”做法。我还想说 UID 链接是一个好主意,因为它使页面对于移动/损坏的链接非常强大。
In the 150+ Plone sites I've helped build, I'd say the vast majority wound up using a central "Images" folder. This might not work for a very large site, but I think it is at least a "reasonably good" practice for many sites. I would also say that UID linking is a good idea, since it makes pages quite robust against moves/broken links.
啊,图像问题;)
你并不孤单,每个曾经使用过 Plone 的人最终都会有同样的问题。
通常我们总是使用相同的文件夹方法或全局文件夹方法。创建图像/文件子文件夹的想法听起来很荒谬。
1) 仅当图像在项目之间共享时,全局文件夹方法才是一种好的方法。如果它们以某种方式组织起来也会有所帮助,否则您的用户将很快迷失并开始重新上传。 Jarn 的 ImageRepository 有很大帮助,但缺乏维护。不过应该可以。
2) 如果您的用户已断开连接、图像无法重复使用且用户权限分散在整个网站上,则将文件上传到与文档相同的文件夹中是很好的选择。您通常还会将它们隐藏在导航中。关于bug,如果是bug的话就会被修复。您提交错误报告了吗?
Ah, the image problem ;)
You are not alone in this one, everybody who has ever worked with Plone has eventually had the same questions.
Typically we always use either the same folder approach or the global folder approach. The idea of creating image/files subfolders sounds preposterous.
1) The global folder approach is a good one only if the images are shared among items. It also helps if they are somehow organized, otherwise your users will quickly get lost and start reuploading all over again. Jarn's ImageRepository helps quite a bit, but lacks maintenance love. Should work though.
2) Uploading in the same folder as the document is great if you have disconnected users, there is no reuse of the images, and user permissions are scattered all over the site. You also typically hide them from navigation. Concerning the bug, if it is a bug it will be fixed. Did you submit your bug report?
我认为这在一定程度上取决于您的网站架构。我们有 5 个主要部分,因此每个部分的顶层都有一个隐藏/非公开可见的 /section/images 和 /section/docs 文件夹。然后,我们将该部分的所有图像/文件放入相应的文件夹中。
我们还有大量的活动和新闻部分,因此在每个部分中,我们都设置了 /media/yyyy/mm 结构,主要用于支持这些活动所需的图像、视频或其他文件。按年份和月份组织这些内容有助于我们清除旧新闻和事件。
I think it depends a little on your site architecture. We have 5 main sections, so we have a hidden/non-publicly viewable /section/images and /section/docs folder within the top level of each section. We then put all images/files for that section in the respective folders.
We also have extensive events and news sections, so in each of those we have /media/yyyy/mm structure set up mostly to support images, video or other files needed for those. Organizing those by year and month helps us when clearing out old news and events.