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?
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.
I have dev'd quit a few galleries with umbraco and think I have it down to a pretty fine art....
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.
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!
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.
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.
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?
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
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:
Hey Kent
I have dev'd quit a few galleries with umbraco and think I have it down to a pretty fine art....
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
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
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
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
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.
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?
is working on a reply...