Update Umbraco to 7.12.2

This commit is contained in:
2018-09-16 15:08:47 -04:00
parent 7ed7776432
commit 616ab81bad
764 changed files with 142787 additions and 66790 deletions
@@ -1,50 +1,47 @@
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@*
Macro to display a gallery of images from media the media section.
Macro to display a gallery of images from the Media section.
Works with either a 'Single Media Picker' or a 'Multiple Media Picker' macro parameter (see below).
How it works:
- Confirm the macro parameter has been passed in with a value
- Loop through all the media Id's passed in (might be a single item, might be many)
- Loop through all the media Ids passed in (might be a single item, might be many)
- Display any individual images, as well as any folders of images
Macro Parameters To Create, for this macro to work:
Alias:mediaIds Name:Select folders and/or images Type: Multiple Media Picker
Type: (note: you can use a Single Media Picker if that's more appropriate to your needs)
Type: (note: You can use a Single Media Picker if that's more appropriate to your needs)
*@
@{ var mediaIds = Model.MacroParameters["mediaIds"]; }
@{ var mediaIds = Model.MacroParameters["mediaIds"] as string; }
@if (mediaIds != null)
{
<ul class="thumbnails">
@foreach (var mediaId in mediaIds.ToString().Split(','))
<div class="row">
@foreach (var mediaId in mediaIds.Split(','))
{
var media = Umbraco.Media(mediaId);
var media = Umbraco.TypedMedia(mediaId);
@* a single image *@
if (media.DocumentTypeAlias == "Image")
{
@Render(media);
@Render(media as Image);
}
@* a folder with images under it *@
if (media.Children("Image").Any())
foreach (var image in media.Children<Image>())
{
foreach (var image in media.Children("Image"))
{
@Render(image);
}
@Render(image);
}
}
</ul>
</div>
}
@helper Render(dynamic item)
@helper Render(Image item)
{
<li class="span2">
<a href="@item.umbracoFile.src" class="thumbnail">
<img src="@item.umbracoFile.src" alt="@item.Name" />
<div class="col-xs-6 col-md-3">
<a href="@item.Url" class="thumbnail">
<img src="@item.GetCropUrl(width:200, height:200)" alt="@item.Name" />
</a>
</li>
</div>
}