Results 1 to 11 of 11

Thread: Best practice for organizing images

  1. #1
    User
    Join Date
    08-15-09.
    Location
    Sweden
    Posts
    82

    Default Best practice for organizing images

    After been using Contao for almost three years now I find it a pleasure to work with. It's not perfect, but it's getting better and better with each update. I have not found a better solution.

    But, one things is bothering me, and that is the organization of images in the file manager.

    A typical scenario:
    You build a site for a company. Set up a few news archives, a banner on the front page, a calendar etc. To organize the images you create some folders in the file manager; "news", "blog", "calendar", "banner", "advertising", "people" etc.

    Everything is nice and clean with several folders where the clients will store the pictures. And this is good, until a year has gone, and the folders are FULL with pictures.

    Now it's not that simple anymore to handle the images, even though you created some nice folders in the beginning. When uploading and choosing an image for a blog post, there is maybe 100+ images in the list, and it's getting more and more problematic finding the right image... :?

    Sure, it would be nice to rearrange the folders to set up a different structure with subfolders etc. But that would be no easy task, since moving files on the server will cause the images not show up in frontend because the URL has changed.

    From this I have two questions:

    1.
    Maybe Contao would change the way images and files are organized? Maybe the Wordpress style where images are stored in folders by date? Or a database driven solution where each uploaded image gets an ID, and can be moved freely?

    2.
    How do you organize uploaded images today? Do you have some good tips organizing the folders in the file manager to make things easier to handle a large amount of images and files? Any suggestions are welcome. Please share your approach to this. :D

  2. #2
    Community-Moderator xchs's Avatar
    Join Date
    06-20-09.
    Posts
    1,292

    Default Re: Best practice for organizing images

    Quote Originally Posted by Ola
    Maybe Contao would change the way images and files are organized? Maybe the Wordpress style where images are stored in folders by date? Or a database driven solution where each uploaded image gets an ID, and can be moved freely?
    In the German community, there have been some discussions (some time ago) about this topic. Additionally, in the ticket system was already asked for a corresponding feature request.

    As far as I know there's planned for Contao 3 a different handling of such static resources (maybe database-based).
    Contao Community Moderator
    → Support options

  3. #3
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Best practice for organizing images

    A great way to manage folders is this way:
    [attachment=0:6f462adf]file-organised.jpg[/attachment:6f462adf]

  4. #4
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: Best practice for organizing images

    Setting up a structure for your client the way Thyon suggest sure would be nice an also solve the problem. I store my files the same way Just using meaningful folders for everything.

    However, I found that at least half of the clients do not stick to the proposed structure (unless I assign rights only to subdirectories, but the original problem remains).

    Why would we not circumvent the problem altogether and make an optional module that adds the option to upload files to any module, content element and other item that might use files. Already any such items contain a file selection part, so targeting them should be possible at least. These uploads should then be placed in a folder managed automatically into unique subfolders and also be usable only by the module, content item or other item that uploaded it. The item can select from the regular file structure at the same time. This also addresses the remarks I get from most clients: "so I have to upload the files first somewhere else?" :?

    There is one drawback that I can come up with. Duplicating contents....

  5. #5
    User
    Join Date
    08-15-09.
    Location
    Sweden
    Posts
    82

    Default Re: Best practice for organizing images

    Good thoughts from all of you. From your post Vera, I did a simple mockup to demonstrate a possible solution.

    The first image shows the settings for a news archive. Here the option to enable a simple image upload is presented. You can choose to what folder the uploaded image will be saved into. Also, there is an option to automatically sort images in subfolders by date.
    [attachment=1:3pgv08fb]Conto-Simple-upload-News-archive.png[/attachment:3pgv08fb]

    The second image shows how the user will be instructed to upload an image to a news item. There is only a simple file upload form. The user cannot choose where the image will be saved. So simple, and the images are sorted nice and clean in the correct folder!
    [attachment=0:3pgv08fb]Conto-Simple-upload-News-item.png[/attachment:3pgv08fb]

    So, what are your thoughts of this?

  6. #6
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: Best practice for organizing images

    That is just about what I meant It is good to have that available throughout the system. The reason being that most of my clients use images on one spot only, or think of the images as part of the contents so expect the file handling with the contents as well. This is something they will understand more easily.

    So like the news upload option as illustrated above it is then

    I'm not sure if the way you show it would be compatible with the existing code, but perhaps someone else can give us an idea of that

  7. #7
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Best practice for organizing images

    You could canibalise the simple upload from IsoTope which pretty much does what you want, and then graft it into News, Events, etc. to override the default behaviours of that field. Also helpful is an internal extension I use, which adds the ability to set a parent folder PER archive (news, events). Then I add this parent folder to the "root" folder for the file manager, then it becomes restricted to that parent, see below. This is very helpful, as i can then force the client to only see the files for news within the news/ folder, I've made for them.

    Archive setting added:
    [attachment=1:3huizb39]news-folderroot.jpg[/attachment:3huizb39]

    Then in NEWS's image folder (AND for enclosures), it looks like this:
    [attachment=0:3huizb39]news-restricted.jpg[/attachment:3huizb39]

    The best option is to auto-add images and files with meta information (I've added this as a feature request). This should be in the feature list (together with a unified user model) for Contao 3 (afaik).

  8. #8
    User
    Join Date
    08-15-09.
    Location
    Sweden
    Posts
    82

    Default Re: Best practice for organizing images

    Quote Originally Posted by thyon
    You could canibalise the simple upload from IsoTope which pretty much does what you want, and then graft it into News, Events, etc. to override the default behaviours of that field.
    Too bad i'm not such a talented developer to make that into an extension. But if anyone would make that work I would be the first one to use that extension.

    Quote Originally Posted by thyon
    Also helpful is an internal extension I use, which adds the ability to set a parent folder PER archive (news, events).
    Is this a public extension? If so, what's the name of it?

  9. #9
    Experienced user
    Join Date
    06-11-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Best practice for organizing images

    nope. it's internal (=private) and not published. you can PM message me and I'll send it to you. The forum posts don't always e-mail me for some reason.

    There is a catch though. Because of a bug (already submitted) in Contao, when the user clicks the pop-up file manager to add a file and return, the root is back to everything again -- which makes this pretty much useless... the pop-up file manager's bug clears out the setting that my extension adds in...

  10. #10
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Best practice for organizing images

    I'm actually looking into this because for some clients it would be useful to have an alternative file handling mechanism. So just to see how this all works I've added the isotope mediamanager to a custom extension and added a field for file uploads to the header element (pretty useless, but the leanest content type to test with). It sort of worked at the first try and uploading is possible, the file is displayed. From that little success it should be more work then the 5 minutes this cost me to build it into a configurable extension that plugs into the default content elements and default extensions. But surely it would be manageable. I'll see how far I can get with this....

  11. #11
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Best practice for organizing images

    Just wanted to let you know I've succeeded partially;
    • I can force specific folders like Thyons internal extension (which was easy enough, but I also got bugged by the filemanager icon that resets the path var)[/*:m:4aqdzoer]
    • I can also add an upload field that uploads to the folder specific to whatever content type where looking at[/*:m:4aqdzoer]

    What I didn't get right is;
    • Uploading new file runs on save. This results in an error message because the first time the filetree is empty so users cannot select files yet (They weren't uploaded before the first save, but Contao tries to save a file selected in the empty filetree).
      Solution: For single source filetree I can simply at the new path to the singleSrc field and the error is solved
      Problem: What to do with the content type gallery? Cannot support a multiple SRC tree properly otherwise.[/*:m:4aqdzoer]
    • The form itself has the wrong enctype if the upload is added through a subpallette. Only after the first save the enctype changes to the type needed for file uploads. Not sure yet how to solve, probably need to add some javascript for this. But need to see if Contao can handle it first.[/*:m:4aqdzoer]

    I have some other things I need to do now first. Perhaps someone can give me a hint about how to solve the problems I'm having?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •