Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 06, 2011 @ 09:50
    Fuji Kusaka
    0

    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

  • Jesper Hauge 298 posts 487 karma points c-trib
    Jun 06, 2011 @ 11:20
    Jesper Hauge
    0

    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

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 06, 2011 @ 11:33
    Fuji Kusaka
    0

    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

  • Jesper Hauge 298 posts 487 karma points c-trib
    Jun 06, 2011 @ 12:11
    Jesper Hauge
    0

    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:

    <folder id="1010" more-attributes="stuff">
      <img id="1011" more-attributes="stuff">
        <umbracofile>/media/10/filename.jpg</umbracofile>
        <umbracowidth>1058</umbracowidth>
        <!-- more properties -->
      </img>
    </folder>

    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

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 06, 2011 @ 12:22
    Jeroen Breuer
    0

    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

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 06, 2011 @ 14:54
    Fuji Kusaka
    0

    Hi Jeroen,

     

    Thanks for the reply...am trying to install the package but somehow getting a web.config error .

    Any Idea?

     

    //fuji

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 06, 2011 @ 15:19
    Jeroen Breuer
    0

    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

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 06, 2011 @ 15:25
    Fuji Kusaka
    0

    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

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 06, 2011 @ 15:37
    Jeroen Breuer
    0

    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

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 07, 2011 @ 05:43
    Fuji Kusaka
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft