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.
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
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
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
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
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
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
is working on a reply...