Skip to content

Instantly share code, notes, and snippets.

View kgiszewski's full-sized avatar

Kevin Giszewski kgiszewski

View GitHub Profile
@kgiszewski
kgiszewski / PVCv7
Created January 13, 2014 16:17
PVC Umbraco v7
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Models.PublishedContent;
using Archetype.Umbraco.Models;
using Archetype.Umbraco.Extensions;
@kgiszewski
kgiszewski / gist:8863822
Last active March 11, 2020 14:12
Archetype Template Use Cases
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using Archetype.Models;
@using Archetype.Extensions;
@{
Layout = null;
}
//use case #1 - Covers a single Archetype
@foreach (var fieldset in Model.Content.GetPropertyValue<ArchetypeModel>("a1"))
{
@kgiszewski
kgiszewski / gist:9842878
Created March 28, 2014 20:59
v7 Umbraco UrlPicker Gist
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using UrlPicker.Umbraco.Models;
@{
Layout = "BasePage.cshtml";
var urlPicker = Model.Content.GetPropertyValue<UrlPicker>("myUrlPickerPropAlias");
}
<div>Name: @urlPicker.Name</div>
@kgiszewski
kgiszewski / gist:10489928
Created April 11, 2014 18:25
Render Umbraco Inline Partial from a RTE Link
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using Umbraco.Core.Models;
using Umbraco.Web;
using Umbraco.Core.Logging;
using HtmlAgilityPack;
@kgiszewski
kgiszewski / gist:8424e1f2d06c109e7624
Created June 23, 2014 15:01
RichTextBlock.cshtml
@inherits Umbraco.Web.Mvc.UmbracoViewPage<ArchetypeFieldsetModel>
@{
if (Model == null)
{
return;
}
}
@Html.Raw(Model.GetValue("code"))
@inherits Umbraco.Web.Mvc.UmbracoViewPage<ArchetypeFieldsetModel>
@using TableEditor.Models;
@using Archetype.Models;
@{
if (Model == null)
{
return;
}
var tableModel = Model.GetValue<TableEditorModel>("table");
@kgiszewski
kgiszewski / gist:f3ae5ecb9d3d01b5dfe9
Created June 23, 2014 15:11
RichTextBlock.cshtml
@inherits Umbraco.Web.Mvc.UmbracoViewPage<ArchetypeFieldsetModel>
@using Archetype.Models;
@if(Model != null && Model.HasValue("text"))
{
<div class="content-block-rte">
@Html.Raw(Model.GetValue("text"))
</div>
}
@kgiszewski
kgiszewski / gist:3398156ecb8fc1e2f384
Created June 23, 2014 15:13
Sample Page Builder Template
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using Archetype.Extensions
@using Archetype.Models
<div>
@Html.RenderArchetypePartials(Model.Content.GetPropertyValue<ArchetypeModel>("content"))
</div>
using System;
using System.Web;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Umbraco.Core;
using Umbraco.Core.Publishing;
using Umbraco.Core.Logging;
//manifest
{
"propertyEditors": [
{
"name": "Store Hours",
"alias": "Imulus.StoreHours",
"editor": {
"valueType": "JSON",
"view": "~/App_Plugins/StoreHours/views/store.hours.html"
},