7

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.

user1017702
  • 295
  • 3
  • 11

3 Answers3

3

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.

Jon Stahl
  • 2,090
  • 10
  • 10
  • Thank you Jon. We just learned about the UID linking feature. So actually there is not Link Integrity bug in plone. – user1017702 Feb 15 '12 at 23:20
  • Thank you Jon. Yes, I guess having a central images and files folder is the best solution. Is there a way to configure TinyMCE so that when user uploads an image or file via TinyMCE's insert/edit image and insert/edit link, the default folder is the central image/file folder instead of the current folder? – user1017702 Feb 15 '12 at 23:31
  • The link Jon provided under my answer contains all info. @user1017702 could you please close/accept your questions and not turn them into discussions? – ggozad Feb 17 '12 at 15:56
2

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?

ggozad
  • 13,105
  • 3
  • 40
  • 49
  • Thank you ggozad. So if the same folder approach is preferred, do you have the problem of image and file links in a page breaking when you move the page to another folder (no problem moving to another folder inside the same parent folder of the page AND on the same level)? We just submitted this bug report: https://dev.plone.org/ticket/12532 – user1017702 Feb 15 '12 at 20:38
  • I haven't had this, but then again we typically use UIDs. Wait and see what responses you will get to your bug. I am sure if it is valid it will be fixed promptly. Also it will be helpful if you indicate exact versions, particularly for Plone and Products.TinyMCE. – ggozad Feb 15 '12 at 20:52
  • hi ggozad. maybe it isn't a bug because we didn't enable Link by UIDs in TinyMCE. Do you know if it is possible to configure the 'global' image folder as the default in TinyMCE insert/edit image window? Thank you. – user1017702 Feb 16 '12 at 02:00
  • Iirc Products.ImageRepository does that for you – ggozad Feb 16 '12 at 06:43
  • 1
    I believe this is addressed at http://stackoverflow.com/questions/5821362/making-tinymce-image-pick-dialog-point-to-a-default-folder-on-plone – Jon Stahl Feb 17 '12 at 15:47
  • http://stackoverflow.com/questions/5821362/making-tinymce-image-pick-dialog-point-to-a-default-folder-on-plone doesn't really say anything. Looks like this cannot really be done. Thanks – user1017702 Feb 20 '12 at 22:27
1

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.

abosio
  • 21
  • 5