Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    Jan 13, 2011 @ 11:38
    Anthony Candaele
    0

    properties of file in Media Library

    Hi,

    Is there a place where I can get more information on the properties (xml elements and attributes) of a File in the Media Library?

    I need this information, because I am implementing a 'Documents' page that lists all documents in a 'Documents' folder in the Media Library

    I want to show the title, description and modified date of each document.

    Thanks for your help,

    Anthony Candaele

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jan 13, 2011 @ 11:47
    Ismail Mayat
    0

    Anthony,

    What version of umbraoc are you using?  In xslt you can do umbraco.library:GetMedia and that will get you the xml for the given file id.  If you do xsl:copy that will dump out the xml structure and you can see what you have out of the box you will get umbracoFile umbracoWidth umbracoHeight and umbracoExtension if you have additional properties added to the file type eg title description then you will see those as well.

    Regards


    Ismail

  • Anthony Candaele 1197 posts 2049 karma points
    Jan 13, 2011 @ 16:24
    Anthony Candaele
    0

    Hi Ismail,

    Thanks for the adivce, I found all the properties I need but one, the createDate attribute of the file element.

    I try to read the createDate attribute like this:

    <td><xsl:value-of select="./file/@createDate" /></td>

    but it doesn't work.

    Anthony

  • Anthony Candaele 1197 posts 2049 karma points
    Jan 13, 2011 @ 16:27
    Anthony Candaele
    0

    I just got it to work like this:

    <td><xsl:value-of select="./@createDate" /></td>

    now I just need to format the date so that I only get the date part without the time part

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 13, 2011 @ 16:29
    Jan Skovgaard
    0

    Hi Anthony

    You can use the umbraco.library:FormatDateTime() extension to do that. It's very well documented in here: http://our.umbraco.org/wiki/reference/umbracolibrary/formatdatetime

    /Jan

  • Anthony Candaele 1197 posts 2049 karma points
    Jan 13, 2011 @ 16:32
    Anthony Candaele
    0

    Hi Jan,

    Yes, I just got the right dateformat like this:

    <td><xsl:value-of select="umbraco.library:FormatDateTime(./@createDate, 'dd/MM/yyyy')" /></td>

    I'm starting to get the hang of it :)

    Just XPath is still a little difficult for me

Please Sign in or register to post replies

Write your reply to:

Draft