Copied to clipboard

Flag this post as spam?

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

  • Siw Ørnhaug 130 posts 109 karma points
    Sep 20, 2011 @ 09:16
    Siw Ørnhaug

    Getting node properties from xslt extension

    I've made an xslt extension that find files to zip and return the path to the zip file which the xslt uses as a link.

    Now I'd like to find additional files to add to the zip, and the path to these files are stored in several properties in two different document types.

    I use $currentPage/@id as parameter to the extension class and I can instanciate a node from this. I can get the nodeTypeAlias BUT I cannot get the properties!

    Why is this and how should I go about it?

  • Rich Green 2246 posts 4008 karma points
    Sep 20, 2011 @ 11:09
    Rich Green

    What version of Umbraco? nodeTypeAlias is the using the old XSLT schema, prehaps your code is mixing schema's?


  • Siw Ørnhaug 130 posts 109 karma points
    Sep 22, 2011 @ 20:45
    Siw Ørnhaug

    Hi Rich,

    I'm sorry I didn't register your reply.

    Now, I've found the solution to my first problem - albeit it may be round-about... I sent the current node id as an input parameter from xslt to my backend cs file function.

    I then found out (after some trials) that I needed to work with Document instead of Node. Now I'm left with 1 type of data I'm still unable to extract directly.

    If I want the physical relative path to a media folder instead of each item within it, I'm kind of stuck. I'm talking about "media/[folder name as a number]"

    I have the folder id, but content type Folder doesn't contain a physical path.

    Of course, I can look at the first item within and extract the actual folder name from there, but isn't there an easier way?

    Any thoughts?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 22, 2011 @ 21:23
    Dirk De Grave

    Hmm, working with Document api instead of using the nodeFactory may cause some performance penalties as the document api will hit the db more than you'd want it to. So, unless you're dealing with non published content, go with the nodeFactory(and Node class) instead of using the Document class api's.

    Anyway, what problem did you encounter when working against the nodeFactory?



  • Siw Ørnhaug 130 posts 109 karma points
    Sep 22, 2011 @ 22:13
    Siw Ørnhaug

    Hi Dirk

    I could pull out id, name and such from node, but not the document properties. In this case they are all media picker based, save one which is a content picker.

    My cs function finds all media items associated with selected documents and zip them up.

    The function is triggered in a download link. It will not be used that often and it's acceptable that it takes some time.

    But I appreciate the information that I should use nodeFactory if I can.  


    So, do you know how to get the physical folder name of a media item of content type Folder?


  • Siw Ørnhaug 130 posts 109 karma points
    Sep 22, 2011 @ 22:29
    Siw Ørnhaug

    By the way - and this is probably the wrong place for this question - but it's related.

    I've tried to upload videos to media folders in this particular case and for some reason I'm unable to get them up if the size exceeds something like 28 Mb. This seems weird to me. I've set the max request time so: maxRequestLength="104857600"

    It doesn't matter whether I use the Desktop Uploader or regular Media Section Upload. What other kinds of limitations can there be?

    I'm using Umbraco 4.7.0

  • Siw Ørnhaug 130 posts 109 karma points
    Sep 25, 2011 @ 23:27
    Siw Ørnhaug

    Seems I found the answer to my last question here:

    I was able to upload a video file of 33 MB after following the procedure there.

    Now if anyone knows a really nifty way to extract the physical path of a media folder from the NodeFactory API... It would make me happy ;-) 

Please Sign in or register to post replies

Write your reply to: