Is it possible to create a folder where i will be able to store images that I will upload by using the file upload property in Umbraco which will then be accessed by an XSLT?
Lets say i want to create a folder for a slideshow name (ImgSlider) and then get my xslt to acess it.
1: You can create a folder in the media section on the backend, and then use umbraco.library:GetMediaItem(id, deep) to get the xml-representation of the folder, and then process this xml in xslt
2: You can create a node in your content tree, with subnodes that has an property with datatype "Upload", this will add the possibility of uploading af file to each node. Paths of the uploaded files will be accessible in the xml as the value of the property you've used for uploading.
If you choose the first option you will be able to get at the size and dimensions of the file, if you're uploading pictures, if you use the second option, there's a possibility of getting these properties by using som "special" property names, but it's not well documented how to do that.
If you need extra properties for the images in your media section (I often need and altText property), you can attach extra properties by editing the mediatype in "Media Types" in the Settings section. Any properties you add to your mediatypes will also be available in the xml provided with umbraco.library:GetMediaItem()
Am used to the 2nd Option, but this time i wanted to make a folder in the media like you mentioned for option 1. But somehow am not sure of how to get the images with the XSLT.
I was going to write a code sample based on the newest version, with the new xml-schema, but as I was testing i discovered something that looks like a bug.
Basically umbraco.library:GetMedia(idInteger, 'true') should return a xml-node looking like this:
But the img tag is missing the closing </img>, which screws up the xml/xslt, rendering it useless.
I don't know if anybody is aware of this and if there's a workaround. But I will check codeplex if there's an issue, and probably create one if there isn't
Hmm that's strange. There should also be 2 extra datatypes DAMP - New and DAMP - Classic which have the Digibiz Advanced Media Picker as the render control.
I need to find out with the IT Dept if this is the McAfee which is blocking me. I know there has been an update last week, but this is not the only package i cant installed.
Image Upload
Hello Guys,
Is it possible to create a folder where i will be able to store images that I will upload by using the file upload property in Umbraco which will then be accessed by an XSLT?
Lets say i want to create a folder for a slideshow name (ImgSlider) and then get my xslt to acess it.
Fuji
Hi Fuji,
You have two out-of-the-box possibilities here.
1: You can create a folder in the media section on the backend, and then use umbraco.library:GetMediaItem(id, deep) to get the xml-representation of the folder, and then process this xml in xslt
2: You can create a node in your content tree, with subnodes that has an property with datatype "Upload", this will add the possibility of uploading af file to each node. Paths of the uploaded files will be accessible in the xml as the value of the property you've used for uploading.
If you choose the first option you will be able to get at the size and dimensions of the file, if you're uploading pictures, if you use the second option, there's a possibility of getting these properties by using som "special" property names, but it's not well documented how to do that.
If you need extra properties for the images in your media section (I often need and altText property), you can attach extra properties by editing the mediatype in "Media Types" in the Settings section. Any properties you add to your mediatypes will also be available in the xml provided with umbraco.library:GetMediaItem()
Hop this will clarify a bit for you.
Regards
Jesper Hauge
Hi Jesper ,
Am used to the 2nd Option, but this time i wanted to make a folder in the media like you mentioned for option 1. But somehow am not sure of how to get the images with the XSLT.
Fuji
Hi Fuji,
I was going to write a code sample based on the newest version, with the new xml-schema, but as I was testing i discovered something that looks like a bug.
Basically umbraco.library:GetMedia(idInteger, 'true') should return a xml-node looking like this:
But the img tag is missing the closing </img>, which screws up the xml/xslt, rendering it useless.
I don't know if anybody is aware of this and if there's a workaround. But I will check codeplex if there's an issue, and probably create one if there isn't
Regards
Jesper Hauge
Hello,
If you want to try option 1 you could try the Digibiz Advanced Media Picker. There is a xslt example on how to use here and I've also got a small video tutorial.
Jeroen
Hi Jeroen,
Thanks for the reply...am trying to install the package but somehow getting a web.config error .
Any Idea?
//fuji
Hello,
Could you have a look at the Umbraco log to see what might cause the error? Are you using an Umbraco 4.5+ website?
Jeroen
I've installed it but i cant see any of the Render Control am supposed to see in the Data Types. Yes am using umbraco v4.7.
Fuji
Hmm that's strange. There should also be 2 extra datatypes DAMP - New and DAMP - Classic which have the Digibiz Advanced Media Picker as the render control.
Jeroen
I need to find out with the IT Dept if this is the McAfee which is blocking me. I know there has been an update last week, but this is not the only package i cant installed.
Fuji
is working on a reply...