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

Commit a2145e9

Browse files
Added support for a default view file if not other file is found
1 parent 5b3cc5d commit a2145e9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
104104
{
105105
return helper.Partial(fullPreviewViewPath, content);
106106
}
107+
108+
fullPreviewViewPath = previewViewPath + "Default.cshtml";
109+
if (ViewEngines.Engines.ViewExists(helper.ViewContext, fullPreviewViewPath, true))
110+
{
111+
return helper.Partial(fullPreviewViewPath, content);
112+
}
107113
}
108114

109115
// Check for view path view
@@ -120,6 +126,12 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
120126
{
121127
return helper.Partial(fullViewPath, content);
122128
}
129+
130+
fullViewPath = viewPath + "Default.cshtml";
131+
if (ViewEngines.Engines.ViewExists(helper.ViewContext, fullViewPath, true))
132+
{
133+
return helper.Partial(fullViewPath, content);
134+
}
123135
}
124136

125137
// Resort to standard partial views

0 commit comments

Comments
 (0)