Could not render component of type: @(item.Content.ContentType.Alias)
-
+
This likely happened because the partial view @partialViewName could not be found.
+ @foreach (var block in Model)
+ {
+ if (block?.ContentKey == null) { continue; }
+ var data = block.Content;
+ var partialViewName = uTPro.Project.Web.Configure.CustomPathViews.GetPathViewBlockListPreview(data.ContentType.Alias, CurrentSite.GetItem().Root.Name);
+ try
+ {
+ @await Html.PartialAsync(partialViewName, block)
+ }
+ catch (InvalidOperationException)
+ {
+
+ Could not render component of type: @(data.ContentType.Alias)
+
+ This likely happened because the partial view @partialViewName could not be found.
+
+ }
+ }
+
diff --git a/uTPro/Project/uTPro.Project.Web/Views/_ViewImports.cshtml b/uTPro/Project/uTPro.Project.Web/Views/_ViewImports.cshtml
index 9182d01..d9c0f88 100644
--- a/uTPro/Project/uTPro.Project.Web/Views/_ViewImports.cshtml
+++ b/uTPro/Project/uTPro.Project.Web/Views/_ViewImports.cshtml
@@ -9,6 +9,8 @@
@using Umbraco.Cms.Core.Models.PublishedContent
@using Microsoft.AspNetCore.Html
@using Umbraco.Community.BlockPreview.Extensions
+@* @using uTPro.Project.Web.Configure *@
+
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@* @addTagHelper *, Smidge *@
@* @inject Smidge.SmidgeHelper SmidgeHelper *@
diff --git a/uTPro/Project/uTPro.Project.Web/Views/globalPageError.cshtml b/uTPro/Project/uTPro.Project.Web/Views/globalPageError.cshtml
index 1c1e49b..338de35 100644
--- a/uTPro/Project/uTPro.Project.Web/Views/globalPageError.cshtml
+++ b/uTPro/Project/uTPro.Project.Web/Views/globalPageError.cshtml
@@ -10,19 +10,21 @@
@{
Layout = null;
- var titlePage = string.IsNullOrWhiteSpace(Context.Items["titlePage"]?.ToString())
+ var titlePage = string.IsNullOrWhiteSpace(Context?.Items["titlePage"]?.ToString())
? "Page Not Found"
- : Context.Items["titlePage"]!.ToString();
+ : Context?.Items["titlePage"]?.ToString();
- var logo = string.IsNullOrWhiteSpace(Context.Items["logo"]?.ToString())
+ var logo = string.IsNullOrWhiteSpace(Context?.Items["logo"]?.ToString())
? "/assets/img/logo.svg"
- : Context.Items["logo"]!.ToString();
+ : Context?.Items["logo"]?.ToString();
- var title = string.IsNullOrWhiteSpace(Context.Items["title"]?.ToString())
+ var title = string.IsNullOrWhiteSpace(Context?.Items["title"]?.ToString())
? titlePage
- : Context.Items["title"]!.ToString();
+ : Context?.Items["title"]?.ToString();
- var message = Context.Items["message"]!.ToString();
+ var message = string.IsNullOrWhiteSpace(Context?.Items["title"]?.ToString())
+ ? String.Empty
+ : Context?.Items["message"]?.ToString();
}
diff --git a/uTPro/Project/uTPro.Project.Web/Views/uTPro/PageHome.cshtml b/uTPro/Project/uTPro.Project.Web/Views/uTPro/PageHome.cshtml
index 2994bd9..56bc7e0 100644
--- a/uTPro/Project/uTPro.Project.Web/Views/uTPro/PageHome.cshtml
+++ b/uTPro/Project/uTPro.Project.Web/Views/uTPro/PageHome.cshtml
@@ -2,4 +2,4 @@
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@{
}
-@await Html.GetBlockGridHtmlAsync(Model.Value("content"))
\ No newline at end of file
+@await Html.GetBlockGridHtmlAsync(Model.Value("content"), CurrentSite.GetItem().Root.Name)
\ No newline at end of file
diff --git a/uTPro/Project/uTPro.Project.Web/Views/uTPro/PageStandard.cshtml b/uTPro/Project/uTPro.Project.Web/Views/uTPro/PageStandard.cshtml
new file mode 100644
index 0000000..56bc7e0
--- /dev/null
+++ b/uTPro/Project/uTPro.Project.Web/Views/uTPro/PageStandard.cshtml
@@ -0,0 +1,5 @@
+@using Umbraco.Cms.Web.Common.PublishedModels;
+@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
+@{
+}
+@await Html.GetBlockGridHtmlAsync(Model.Value("content"), CurrentSite.GetItem().Root.Name)
\ No newline at end of file
diff --git a/uTPro/Project/uTPro.Project.Web/Views/uTPro/blockgrid/Components/Article.cshtml b/uTPro/Project/uTPro.Project.Web/Views/uTPro/blockgrid/Components/Article.cshtml
new file mode 100644
index 0000000..816c16f
--- /dev/null
+++ b/uTPro/Project/uTPro.Project.Web/Views/uTPro/blockgrid/Components/Article.cshtml
@@ -0,0 +1,38 @@
+@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage>
+@{
+}
+
+ Could not render component of type: @(item.Content.ContentType.Alias)
+
+ This likely happened because the partial view @partialViewName could not be found.
+