Posts

Showing posts from 2018

Umbraco 7 Umbraco Strip and Umbraco Truncate - usefull for landing pages

<p>@Umbraco.StripHtml(@Umbraco.Truncate(@Umbraco.Content(1067).bodyText, 300))</p>

Umbraco 7 Get Image Crop from Media ID for specific image,simple version razor sniper

Image
In Umbraco 7 to get a image crop from a image media item in the media folder, suppply the Media id number and the name of the image crop:  <img src="@Umbraco.Media( 1297 ).GetCropUrl("umbracoFile"," i mageCropName ")" class="img-responsive">

Umbraco 7 Get Crops from Multi Media Picker for Image Gallery

Working in 7.9.2: @inherits Umbraco.Web.Mvc.UmbracoTemplatePage @if(CurrentPage.HasValue("galleryImages"))                     {                         <div class="row">                                                     @{                             char[] splitChar = { ',' };                             string[] ids = CurrentPage.galleryImages.ToString().Split(splitChar, StringSplitOptions.RemoveEmptyEntries);                             }                             @foreach (var id in CurrentPage.galleryImages )                             {                         int imageId = int.Parse(id.ToString());                             <div class="col-md-6">                                <a href="@id.Url" data-fancybox="group" data-caption="@id.Name">                                     <img src="@Umbraco.Media(@imageId).GetCropUrl("umbracoFile","square")" alt=&