For the Razor function, you can have something like this:
@inherits RazorFunction
@functions {
public override string FunctionDescription
{
get { return "A function that lists PDF downloads."; }
}
[FunctionParameter(Label="Folder")]
public DataReference<IMediaFileFolder> folderWithPDF { get; set; }
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<div>
@if (folderWithPDF != null)
{
<ul>
@foreach (var pdfFile in Data.Get<IMediaFile>().Where(p => p.FolderPath == folderWithPDF.Data.Path))
{
<li>
@pdfFile.Title
<br />
<a href="~/media(@pdfFile.Id)">Download</a>
</li>
}
</ul>
}
</div>
</body>
</html>