ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Multiple images for a weblog

May 07, 2008 6:13pm

Subscribe [4]
  • #1 / May 07, 2008 6:13pm

    Andy Harris

    958 posts

    Hi all - lets say you have a weblog and you decide that weblog can have 6 images assigned to it. I’ve just done this, and I created 6 custom weblog fields which each were labelled ‘image 1’, ‘image 2’ etc. Obviously the downside here is that I’m restricted to 6 images unless I add more custom fields.

    Has anyone else done something similar to this, and if so what technique did you use? I’m considering a seperate weblog to hold images for another weblog, and then related to each other, which will allow me to add unlimited images.

    Just wondering if there are other ways I’m overlooking really. I seem to be having this requirement in quite a few projects so a better way would be cool.

  • #2 / May 07, 2008 9:57pm

    Arun S.

    792 posts

    I’ve done/am doing this on two projects in two different ways.

    In the first project I did it the way you describe with related entries.  This approach fits the workflow model for that particular site as images arent’t always going to be added at the initial time of posting.

    In the second project, the client/author needed a way to upload an unlimited amount of images (could be no images, could be 20).  So, I just created one custom field for images (textarea).  The client then adds all the images (via the standard upload utility) into that custom field.  I then wrote a plugin that would parse just that field and spit out all the images in an unordered list so that I could style them with CSS.  The plugin is very specific to that site but wasn’t hard to do.

    So, it really depends on 1) the workflow and 2) the display.  If you need to place the images in different spots, then it might be better to use 6 different fields.  If they’re all added together, the way I did it might work for you.

  • #3 / May 07, 2008 10:11pm

    Mark Bowen

    12637 posts

    Hi Andy,

    There’s a few ways you can go about this one. You can use related entries as you have already stated or a plugin as mentioned above. There is one here that may help you out. Also don’t forget the excellent Multi Text extension by Mark Huot which pretty much would allow you to keep on creating fields one after the other in the control panel whenever you need new ones.

    Hope they help a bit.

    Best wishes,

    Mark

  • #4 / May 07, 2008 11:03pm

    seajay

    109 posts

    I’ve been experimenting with the Playa extension and Selected Items module for this very purpose.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases