I am creating a website that allows the admin to create pages of houses that are for sale.
Each page can have upto 6 images. Currently I have them as a 'upload' property type, one for each photo.
Is a mediapicker a better option here? Only problem with the mediapicker is that I have been unable to get the full url path of the image. So use the 'upload' data type a lot easier
If you are using the Upload dataype, the only way to get a description with each image would be to add text fields for each upload box, ie Picture 1 Description, Picture 1 Upload, etc etc. Which wouldn't be hard but it might not be the "cleanest" way.
If you use a Media Picker you could use the media node's name as your description (depending on how long/complex these "descriptions" are) - or, you could add a field to the Image media type (or create a custom one) with the additional inputs you need. You could then use uComponents Multi Node Tree Picker to have one datatype to select all the images. Even better, you might try Jeroen's new Digibiz Advanced Media Picker (DAMP) that will allow you to pick multiple images and also upload them from the datatype. Both packages will allow you to limit the images to 6 and prevent you from having to make 6 fields.
Another good idea would be to use the new Embedded Content package and add two fields, Image Description (text) and Image (media picker).
Personally, I would probably use DAMP as it makes it easier for the end user by allowing them to upload images, create folders, etc right from their content. My next choice would be Embedded Content but I'm not sure if that allows upload directly from the datatype (may or may not be a big deal).
Anyway, there are loads of options, it's really about what works best for you and your editors. In all 3 cases you'd use XSLT to render your output - if you get stuck just let us know! Let us know how you get on or if any questions...
I have been using both upload fields and extended media types and it is better to use media items.
The problem I had/have with the upload field is that some editors copy the page they created last week. Then delete the images and upload new images on the newly copied page. The result is that the image from the original page disappeared. Maybe this behavior has changed with 4.6, I am not sure about that.
You can extend media types or create new media types just like document types and I would recommend doing it this way and not use the upload fields. It might save you some headaches.
The result should give you a list of all the data nodes for the media item and the name of that alias attribute. This way it shows which attributes you have and what the value for these fields are. Len.
Media Picker / image upload advice
Hi.
I am creating a website that allows the admin to create pages of houses that are for sale.
Each page can have upto 6 images. Currently I have them as a 'upload' property type, one for each photo.
Is a mediapicker a better option here? Only problem with the mediapicker is that I have been unable to get the full url path of the image. So use the 'upload' data type a lot easier
To extend these images, I would ideally need to put a description with each image. Is this possible?
Thanks
Tom
Hi Tom,
If you are using the Upload dataype, the only way to get a description with each image would be to add text fields for each upload box, ie Picture 1 Description, Picture 1 Upload, etc etc. Which wouldn't be hard but it might not be the "cleanest" way.
If you use a Media Picker you could use the media node's name as your description (depending on how long/complex these "descriptions" are) - or, you could add a field to the Image media type (or create a custom one) with the additional inputs you need. You could then use uComponents Multi Node Tree Picker to have one datatype to select all the images. Even better, you might try Jeroen's new Digibiz Advanced Media Picker (DAMP) that will allow you to pick multiple images and also upload them from the datatype. Both packages will allow you to limit the images to 6 and prevent you from having to make 6 fields.
Another good idea would be to use the new Embedded Content package and add two fields, Image Description (text) and Image (media picker).
Personally, I would probably use DAMP as it makes it easier for the end user by allowing them to upload images, create folders, etc right from their content. My next choice would be Embedded Content but I'm not sure if that allows upload directly from the datatype (may or may not be a big deal).
Anyway, there are loads of options, it's really about what works best for you and your editors. In all 3 cases you'd use XSLT to render your output - if you get stuck just let us know! Let us know how you get on or if any questions...
Thanks,
Tom
Hi Tom,
I have been using both upload fields and extended media types and it is better to use media items.
The problem I had/have with the upload field is that some editors copy the page they created last week. Then delete the images and upload new images on the newly copied page. The result is that the image from the original page disappeared. Maybe this behavior has changed with 4.6, I am not sure about that.
There are some projects that address this problem: http://our.umbraco.org/projects/fix-cloned-upload-fields-bug
You can extend media types or create new media types just like document types and I would recommend doing it this way and not use the upload fields. It might save you some headaches.
Thx/L.
Hi. Thanks for that.
I was able to extend the media picker options so they have to give it a title and some brief information.
How can I now call this information and get it displayed on screen? The property type is "photoX" and it has values like "title" and "info".
Thanks
Tom
Hi Tom,
This should help. Untested code ahead...
The number 12345 represents the ID of the media node.
The result should give you a list of all the data nodes for the media item and the name of that alias attribute. This way it shows which attributes you have and what the value for these fields are.
Len.
Hi, thanks for that.
I'll need to get the ID of the node dynamically though, for each current page?
I finally got some code working:
<xsl:if test="$currentPage/photo1 != ''">
<img id="main" width="562" height="345" alt="" src="{umbraco.library:GetMedia($currentPage/photo1,0)/umbracoFile}" />
</xsl:if>
Can I get further information (Title, height, width, etc) to work with this one?
Yes, you can get some attributes from Umbraco:
http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
For your title attribute that would be
Hello,
If you're using the Digibiz Advanced Media Picker you can find some examples on how to use it in this topic: http://our.umbraco.org/forum/using/ui-questions/16806-Best-way-to-implement-multiple-media-pickers?p=1#comment63368.
Jeroen
is working on a reply...