Skip to content

Instantly share code, notes, and snippets.

@nul800sebastiaan
Last active December 11, 2015 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nul800sebastiaan/4620491 to your computer and use it in GitHub Desktop.
Save nul800sebastiaan/4620491 to your computer and use it in GitHub Desktop.
Razor media
@if (post.HasValue("mediaFolder"))
{
var media = library.MediaById(post.mediaFolder);
foreach (var item in media.Children())
{
<li>
<a href="@item.umbracoFile">
<img style="width: 100px; height: 100px;" src="@item.umbracoFile" />
</a>
</li>
}
}
@nul800sebastiaan
Copy link
Author

ms.Save(folder);
document.SetValue("mediaFolder", folder.Id);

@nul800sebastiaan
Copy link
Author

StatusUpdate doctype: add prop - mediaFolder of type
media picker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment