I have a document type that uses a media picker field called "file". I chose a PDF in the page instance and saved/published. In my XSLT, I have a link to it:
But, oddly, all this is outputting is a NUMBER (eg. "1453"). Why wouldn't it give me the path to the file?? How can I get this to print in the href? 1453 is meaningless.
I'm getting inconsisten results when trynig to get filenames from either media picker fields or upload fields. In this case, I have a doc type which has one property-- DownloaFile-- and all I am trying to do is to insert the filenames into an href tag in a list of links in the XSLT file. Here is my code:
Me thinks media picker fields and upload fields store their values differently. Media pickers store the id of the media it references while an upload field complete file info on the document node itself.
For media pickers, you could use the code from your last post, for upload fields, you'd need a slightly different approach (altho don't know by heart which one). I always tend to output the value for the property first, and change the xslt according to the output.
how to get filename from media picker field?
Hi,
I have a document type that uses a media picker field called "file". I chose a PDF in the page instance and saved/published. In my XSLT, I have a link to it:
But, oddly, all this is outputting is a NUMBER (eg. "1453"). Why wouldn't it give me the path to the file?? How can I get this to print in the href? 1453 is meaningless.
Thanks,
Garrett
Try:
You probably need getMedia
Dan
Actually, GetMedia isn't working but Ricky's code is.... Thanks to you both! This is the best Forum ever, btw....
//Garrett
I'm getting inconsisten results when trynig to get filenames from either media picker fields or upload fields. In this case, I have a doc type which has one property-- DownloaFile-- and all I am trying to do is to insert the filenames into an href tag in a list of links in the XSLT file. Here is my code:
What's wrong with this? I'm getting an "Error parsing XSLT file: \xslt\VendorDocumentList.xslt" error.
Thanks for the continued help.
//Garrett
Try this:
<li>
(ofcourse surrounded with your for-each)
HTH,
Peter
Me thinks media picker fields and upload fields store their values differently. Media pickers store the id of the media it references while an upload field complete file info on the document node itself.
For media pickers, you could use the code from your last post, for upload fields, you'd need a slightly different approach (altho don't know by heart which one). I always tend to output the value for the property first, and change the xslt according to the output.
Output field value of property using:
Hope this helps.
Regards,
/Dirk
is working on a reply...