diff --git a/build/build.ps1 b/build/build.ps1 index bd487c17d1..ae59874e6a 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -355,11 +355,12 @@ Write-Host "Copy template files" $this.CopyFiles("$templates", "*", "$tmp\Templates") - Write-Host "Copy program.cs and startup.cs for templates" + Write-Host "Copy files for dotnet templates" $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "Program.cs", "$tmp\Templates\UmbracoSolution") $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "Startup.cs", "$tmp\Templates\UmbracoSolution") $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "appsettings.json", "$tmp\Templates\UmbracoSolution") $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "appsettings.Development.json", "$tmp\Templates\UmbracoSolution") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\Views", "*", "$tmp\Templates\UmbracoSolution\Views") $this.RemoveDirectory("$tmp\Templates\UmbracoSolution\bin") }) diff --git a/src/Umbraco.Web.Common/Extensions/GridTemplateExtensions.cs b/src/Umbraco.Web.Common/Extensions/GridTemplateExtensions.cs index e4a1c0d117..b60c93cb68 100644 --- a/src/Umbraco.Web.Common/Extensions/GridTemplateExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/GridTemplateExtensions.cs @@ -7,7 +7,7 @@ namespace Umbraco.Extensions { public static class GridTemplateExtensions { - public static IHtmlContent GetGridHtml(this IHtmlHelper html, IPublishedProperty property, string framework = "bootstrap3") + public static IHtmlContent GetGridHtml(this IHtmlHelper html, IPublishedProperty property, string framework = "Bootstrap3") { var asString = property.GetValue() as string; if (asString != null && string.IsNullOrEmpty(asString)) return new HtmlString(string.Empty); @@ -18,7 +18,7 @@ namespace Umbraco.Extensions public static IHtmlContent GetGridHtml(this IHtmlHelper html, IPublishedContent contentItem) { - return html.GetGridHtml(contentItem, "bodyText", "bootstrap3"); + return html.GetGridHtml(contentItem, "bodyText", "Bootstrap3"); } public static IHtmlContent GetGridHtml(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias) @@ -26,7 +26,7 @@ namespace Umbraco.Extensions if (propertyAlias == null) throw new ArgumentNullException(nameof(propertyAlias)); if (string.IsNullOrWhiteSpace(propertyAlias)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(propertyAlias)); - return html.GetGridHtml(contentItem, propertyAlias, "bootstrap3"); + return html.GetGridHtml(contentItem, propertyAlias, "Bootstrap3"); } public static IHtmlContent GetGridHtml(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias, string framework) @@ -47,7 +47,7 @@ namespace Umbraco.Extensions public static IHtmlContent GetGridHtml(this IHtmlHelper html, IPublishedElement contentItem) { - return html.GetGridHtml(contentItem, "bodyText", "bootstrap3"); + return html.GetGridHtml(contentItem, "bodyText", "Bootstrap3"); } public static IHtmlContent GetGridHtml(this IHtmlHelper html, IPublishedElement contentItem, string propertyAlias) @@ -55,7 +55,7 @@ namespace Umbraco.Extensions if (propertyAlias == null) throw new ArgumentNullException(nameof(propertyAlias)); if (string.IsNullOrWhiteSpace(propertyAlias)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(propertyAlias)); - return html.GetGridHtml(contentItem, propertyAlias, "bootstrap3"); + return html.GetGridHtml(contentItem, propertyAlias, "Bootstrap3"); } public static IHtmlContent GetGridHtml(this IHtmlHelper html, IPublishedElement contentItem, string propertyAlias, string framework) @@ -73,7 +73,7 @@ namespace Umbraco.Extensions return html.Partial(view, model); } - public static IHtmlContent GetGridHtml(this IPublishedProperty property, IHtmlHelper html, string framework = "bootstrap3") + public static IHtmlContent GetGridHtml(this IPublishedProperty property, IHtmlHelper html, string framework = "Bootstrap3") { var asString = property.GetValue() as string; if (asString != null && string.IsNullOrEmpty(asString)) return new HtmlString(string.Empty); @@ -84,7 +84,7 @@ namespace Umbraco.Extensions public static IHtmlContent GetGridHtml(this IPublishedContent contentItem, IHtmlHelper html) { - return GetGridHtml(contentItem, html, "bodyText", "bootstrap3"); + return GetGridHtml(contentItem, html, "bodyText", "Bootstrap3"); } public static IHtmlContent GetGridHtml(this IPublishedContent contentItem, IHtmlHelper html, string propertyAlias) @@ -92,7 +92,7 @@ namespace Umbraco.Extensions if (propertyAlias == null) throw new ArgumentNullException(nameof(propertyAlias)); if (string.IsNullOrWhiteSpace(propertyAlias)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(propertyAlias)); - return GetGridHtml(contentItem, html, propertyAlias, "bootstrap3"); + return GetGridHtml(contentItem, html, propertyAlias, "Bootstrap3"); } public static IHtmlContent GetGridHtml(this IPublishedContent contentItem, IHtmlHelper html, string propertyAlias, string framework) diff --git a/src/Umbraco.Web.UI.NetCore/Views/_ViewImports.cshtml b/src/Umbraco.Web.UI.NetCore/Views/_ViewImports.cshtml new file mode 100644 index 0000000000..7770ecdc5f --- /dev/null +++ b/src/Umbraco.Web.UI.NetCore/Views/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@using Umbraco.Extensions +@using Umbraco.Web.UI.NetCore +@using Umbraco.Web.PublishedModels +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers