Can someone help me sorting out how to display Media Files (pdf) which i previously added in the Media Content. My approched was to create a XSLT files and make use of the Macro in my editor by using the Type mediaCurrent to access specific Folder in the Media diretory where it will display a list of pdf but nothing is showing up.
mediaCurrent is a little tricky, it returns the XML for the media item you select, but not it's children. So you need to use GetMedia to get the children.
The above should work for that, just change /Image to /File or whatever the alias of your PDF media types are. And get rid of the <img ..>
You'll need to add a parameter to the macro in Developer -> Macros -> (Your Macro), of type mediaCurrent, and place the alias in place of "yourParam" in the above example. Then check the "Allow in editor" box and you should be able to insert it into the editor, and use the mediaCurrent param to select the folder that contains your PDFs.
Media File
Hi there,
Can someone help me sorting out how to display Media Files (pdf) which i previously added in the Media Content. My approched was to create a XSLT files and make use of the Macro in my editor by using the Type mediaCurrent to access specific Folder in the Media diretory where it will display a list of pdf but nothing is showing up.
I tried GetMedia but still nothing.
Any advise please?
//fuji
Hi Fuji,
mediaCurrent is a little tricky, it returns the XML for the media item you select, but not it's children. So you need to use GetMedia to get the children.
Ex:
-Tom
Hi Tom,
Am all confused!!! What am trying to do is insert a macro in my editor which will display all the pdf in my media section.
//fuji
The above should work for that, just change /Image to /File or whatever the alias of your PDF media types are. And get rid of the <img ..>
You'll need to add a parameter to the macro in Developer -> Macros -> (Your Macro), of type mediaCurrent, and place the alias in place of "yourParam" in the above example. Then check the "Allow in editor" box and you should be able to insert it into the editor, and use the mediaCurrent param to select the folder that contains your PDFs.
Does that make sense?
Thanks Tom,
But still not getting anything. Here is how i did it.
1. create XSLT (clean) then in my Macro I Alias(pdfFiles) and type MediaCurrent
2. Marco Properties > Check (Use in Editor)
3. And when i insert the macro in my editor, choose the folder in media where the pdf files lies.
What am i doing wrong??
That should be it, except if you are using my example you need to change yourParam to pdfFiles, and /Image to /File
What results are you getting? Can you post your XSLT?
Its working i had the same page running on another browser!!! Here is the XSLT
But am not getting the actual link to download the file.
For the link, you don't need to use NiceURL (actually it doesnt apply to Media), you just get the umbracoFile property:
As far as the browser issue I'm not sure, try checking what HTML is getting outputted in the source.
-Tom
Thanks for the Help Tom....
is working on a reply...