Last active
August 28, 2017 19:37
-
-
Save kgiszewski/29db03b5f20e3b0858fbad55dcbc0989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AboutUsModel : RenderModel | |
{ | |
public IPublishedContent MainImage { get; } | |
public string MainImageUrl { get; } | |
public AboutUsModel(IPublishedContent content) | |
: base(content) | |
{ | |
MainImage = Content.GetHeaderImage("mainImage"); | |
MainImageUrl = MainImage.Url.GetCropUrl(width: 1200).EnsureRelativeUrl(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Archetype.Extensions | |
@using Archetype.Models | |
@using Umbraco.Web | |
@inherits Umbraco.Web.Mvc.UmbracoViewPage<KGLLC.OakGrove.Models.AboutUsModel> | |
@{ | |
Layout = "~/Views/OakGrove/Base.cshtml"; | |
} | |
<div id="about-us-parallax" class="parallaxModule title" data-parallax="scroll" data-image-src="@Model.MainImageUrl"> | |
<div class="container"> | |
</div> | |
</div> | |
<div class="container margin-top-20"> | |
</div> | |
@Html.RenderArchetypePartials(Model.Content.GetPropertyValue<ArchetypeModel>("modules"), "~/Views/OakGrove/Partials/Archetype/") | |
<div class="container margin-bottom-20"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
using KGLLC.OakGrove.Models; | |
using Umbraco.Web.Models; | |
using Umbraco.Web.Mvc; | |
namespace KGLLC.OakGrove.Controllers | |
{ | |
public class OakGroveAboutUsPageController : RenderMvcController | |
{ | |
public override ActionResult Index(RenderModel model) | |
{ | |
return View("~/Views/OakGrove/OakGroveAboutUsPage.cshtml", new AboutUsModel(model.Content)); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using KGLLC.Umbraco.Common.Extensions | |
@inherits Umbraco.Web.Mvc.UmbracoViewPage<Archetype.Models.ArchetypeFieldsetModel> | |
<section class="container richtext-module"> | |
<div class="col-md-12"> | |
@Html.Raw(Model.GetValue<string>("text")) | |
</div> | |
</section> |
richtextModule
is the fieldset alias for an Archetype.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OakGroveAboutUsPage
is the document type alias.ArchetypeFieldsetModel
class the Archetype partial should inherit.@Html.RenderArchetypePartials(Model.Content.GetPropertyValue<ArchetypeModel>("modules"), "~/Views/OakGrove/Partials/Archetype/")
<==modules
is the document type property alias name."~/Views/OakGrove/Partials/Archetype/"
is the path to the partials.text
is the Archetype property alias.