Files
Umbraco-CMS/src/Umbraco.Web/Macros/PartialViewMacroPage.cs
Shannon Deminick 28c55320a1 Updates the pull request for handling macro errors.
Backports fixes for partial view macros from 6.x - U4-1488, U4-1844, U4-1730, U4-1843
2013-03-11 20:11:11 +06:00

28 lines
849 B
C#

using System.Web.Mvc;
using Umbraco.Core.Models;
using Umbraco.Web.Models;
using Umbraco.Web.Mvc;
namespace Umbraco.Web.Macros
{
/// <summary>
/// The base view class that PartialViewMacro views need to inherit from
/// </summary>
public abstract class PartialViewMacroPage : UmbracoViewPage<PartialViewMacroModel>
{
protected override void InitializePage()
{
base.InitializePage();
//set the model to the current node if it is not set, this is generally not the case
if (Model != null)
{
CurrentPage = Model.Content.AsDynamic();
}
}
/// <summary>
/// Returns the a DynamicPublishedContent object
/// </summary>
public dynamic CurrentPage { get; private set; }
}
}