Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • kentiler 76 posts 69 karma points
    Mar 01, 2010 @ 03:52
    kentiler
    0

    How should I do a doctype with multiple images (1-n)?

    Hi,

    I have to implement a new document type where each page will have multiple images displayed in it through a jquery gallery.  There could be any number of images for this gallery. 

    In some CMS's I can define a document template that will always create an images folder below it, thus giving it a pre-defined location for the images to be put.

    However, with the media and folders not working that way with Umbraco, this will not work. 

    I need a way to let the end users create multiple of these pages, and each page having their own set of images for the gallery.  What is the best way to implement this?

    Thank you!

    --Kent Iler

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Mar 01, 2010 @ 03:56
    Aaron Powell
    3

    We create a "Container" style doc type, which is nothing more than dumb doc type which you create children of. I'd then create a doc type called Image (or something along those lines), add a Media Picker to it and allow it as a child of the container.

    Resulting in a tree like this:

    - Image Gallery (Photo Gallery Doc Type)
    -- Photos (Container Doc Type)
    --- Photo 1 (Image Doc Type)
    --- Photo 2 (Image Doc Type)
    --- Photo n (Image Doc Type)
  • Josh Reid 182 posts 258 karma points
    Mar 01, 2010 @ 12:01
    Josh Reid
    0

    Hey Kent

    I have dev'd quit a few galleries with umbraco and think I have it down to a pretty fine art....

    1. I install treeMultiPicker (Thanks to lefteris for a good few years of his original) and use the MultiMediaPicker DataType to select media from the media tree, and add that property to my Gallery docType ie: images.
    2. I use MultipleFileUpload to get loads of media into a 'gallery page' media folder, from which i can easily group each gallery and mange the media, ie: if i want more data with my images i might add a description (textarea) property to the image mediaType.

    Then I can choose the media directly from the gallery node and is by far the fastest way to sort and manage a lot of images (leave images where they should be in media) and iterate and output the images property with xslt really easily.

    But as everything has a caveat, this method will not allow indexing of the image data for say XSLTsearch, so example you can search the gallery properties, but not the media as they exist in the media tree, but if this is not an issue for you then this is definitely the route i suggest!

    Got plenty of snippets if you stumble.

    Hope you enjoy, chrs.
    J

  • Jesper Hauge 298 posts 487 karma points c-trib
    Mar 01, 2010 @ 13:04
    Jesper Hauge
    0

    I use the same approach as Slace, all though I frequently leave out the container doctype, and just allow image doctypes beneath the parent doctype in question.

    Be aware of the "built-in" doctype properties, umbracoBytes, umbracoWidth, umbracoHeight when creating the Image doctype. If you create label-type properties with these names on the Image doctype with a upload field they will automatically be populated.This will help you when using the doctype from xslt.

    Regards
    Jesper Hauge

  • dandrayne 1138 posts 2262 karma points
    Mar 01, 2010 @ 13:41
    dandrayne
    0

    I usually go the "macro route", and allow editors to insert galleries whereever they want, unless the  gallery is integral to the site (such as a portfolio).  You can see an example of this at http://playground.geckonm.com/a-gallery.aspx, and the package is at http://our.umbraco.org/projects/jqgallery

    Dan

  • kentiler 76 posts 69 karma points
    Mar 02, 2010 @ 01:45
    kentiler
    0

    My only thought about Slace's approach is it will be more difficult for the end user to use.  They would have to create the structure each time they want to do a new gallery.

    My goal is to just let them add a new gallery page, and have the structure, etc. ready.  I'm thinking that Josh's approach may be best from reading everything so far.  If I'm missing something, please let me know.

    Josh - any snippets would be greatly appreciated - the XSLT to pull the data from the treeMutliPicker, etc.

    Thanks everyone for the info!

    --Kent

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Mar 02, 2010 @ 01:48
    Aaron Powell
    0

    You can use events to create the sub-structure, that's what we'll do when we have a complex sub-structure which we need for a doc type.

  • Tom 713 posts 954 karma points
    Mar 02, 2010 @ 05:09
    Tom
    0

    Does this allow for security to be placed on the "Image" document types so you can restrict via permissioning? like if you wanted to restrict access to an image you could essentially put a usercontrol macro in the template and validate?

Please Sign in or register to post replies

Write your reply to:

Draft