Skip to content

Instantly share code, notes, and snippets.

@wjonesy
wjonesy / Base.cshtml
Last active November 8, 2021 17:37
A gist for using responsive images in Umbraco's grid editor
@model dynamic
@using Umbraco.Web.Templates
@functions {
public static string EditorView(dynamic contentItem)
{
string view = contentItem.editor.render != null ? contentItem.editor.render.ToString() : contentItem.editor.view.ToString();
view = view.ToLower().Replace(".html", ".cshtml");
if (!view.Contains("/"))