Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit a30fc0f

Browse files
committed
Revert "Add Helper to get current page"
This reverts commit cb59ec2.
1 parent cb59ec2 commit a30fc0f

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

src/Our.Umbraco.DocTypeGridEditor/Web/Extensions/HtmlHelperExtensions.cs

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
1-
using Our.Umbraco.DocTypeGridEditor.Composing;
2-
using Our.Umbraco.DocTypeGridEditor.Web.Helpers;
3-
using System.Web;
1+
using System.Web;
42
using System.Web.Mvc;
53
using System.Web.Mvc.Html;
4+
using Our.Umbraco.DocTypeGridEditor.Composing;
5+
using Our.Umbraco.DocTypeGridEditor.Web.Helpers;
66
using Umbraco.Core;
77
using Umbraco.Core.Models.PublishedContent;
88

99
namespace Our.Umbraco.DocTypeGridEditor.Web.Extensions
1010
{
1111
public static class HtmlHelperExtensions
1212
{
13-
public static IPublishedContent GetContainerPage(this HtmlHelper helper)
14-
{
15-
//return helper.ViewData["DTGE_ContainerPage"] as IPublishedContent;
16-
if (helper.ViewContext.TempData.ContainsKey("dtgeContainerPage"))
17-
{
18-
return helper.ViewContext.TempData["dtgeContainerPage"] as IPublishedContent;
19-
}
20-
return null;
21-
}
22-
2313
public static HtmlString RenderDocTypeGridEditorItem(
2414
this HtmlHelper helper,
2515
IPublishedElement content,
26-
IPublishedContent containerPage,
2716
string editorAlias = "",
2817
string viewPath = "",
2918
string previewViewPath = "",
@@ -40,12 +29,6 @@ public static HtmlString RenderDocTypeGridEditorItem(
4029
if (string.IsNullOrWhiteSpace(previewViewPath) == false)
4130
previewViewPath = previewViewPath.EnsureEndsWith('/');
4231

43-
//Store the container page reference away for later
44-
if (containerPage != null)
45-
{
46-
helper.ViewContext.TempData["dtgeContainerPage"] = containerPage;
47-
}
48-
4932
var routeValues = new
5033
{
5134
dtgeModel = content,

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Render/DocTypeGridEditor.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
string contentTypeAlias = "";
1212
string value = Model.value.value.ToString();
1313
string viewPath = Model.editor.config.viewPath.ToString();
14-
IPublishedContent containerPage = UmbracoContext.PublishedRequest.PublishedContent;
14+
1515
try
1616
{
1717
contentTypeAlias = Model.value.dtgeContentTypeAlias.ToString();
@@ -25,6 +25,6 @@
2525
{
2626
var content = DocTypeGridEditorHelper.ConvertValueToContent(id, contentTypeAlias, value);
2727

28-
@Html.RenderDocTypeGridEditorItem(content, containerPage, editorAlias, viewPath)
28+
@Html.RenderDocTypeGridEditorItem(content, editorAlias, viewPath)
2929
}
3030
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@using Our.Umbraco.DocTypeGridEditor.Web.Extensions
22
@inherits Umbraco.Web.Mvc.UmbracoViewPage<Our.Umbraco.DocTypeGridEditor.Web.PreviewModel>
3-
@Html.RenderDocTypeGridEditorItem(Model.Item, Model.Page, Model.EditorAlias, Model.ViewPath, Model.PreviewViewPath, true)
3+
@Html.RenderDocTypeGridEditorItem(Model.Item, Model.EditorAlias, Model.ViewPath, Model.PreviewViewPath, true)

0 commit comments

Comments
 (0)