From 9a3f77ed83927dafdfc52ce9fcc5bdd0d48843fe Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Wed, 15 Sep 2021 09:45:15 +0200 Subject: [PATCH] Added option to set NoNodesViewPath in umbraco template. --- .../.template.config/dotnetcli.host.json | 4 ++ .../.template.config/ide.host.json | 7 ++++ .../.template.config/template.json | 37 +++++++++++++++++++ .../appsettings.Development.json | 3 ++ 4 files changed, 51 insertions(+) diff --git a/build/templates/UmbracoProject/.template.config/dotnetcli.host.json b/build/templates/UmbracoProject/.template.config/dotnetcli.host.json index fb990c8902..d0548110fd 100644 --- a/build/templates/UmbracoProject/.template.config/dotnetcli.host.json +++ b/build/templates/UmbracoProject/.template.config/dotnetcli.host.json @@ -28,6 +28,10 @@ "ConnectionString":{ "longName": "connection-string", "shortName": "" + }, + "NoNodesViewPath":{ + "longName": "no-nodes-view-path", + "shortName": "" } }, "usageExamples": [ diff --git a/build/templates/UmbracoProject/.template.config/ide.host.json b/build/templates/UmbracoProject/.template.config/ide.host.json index af5ff5e24c..8b8d2608cd 100644 --- a/build/templates/UmbracoProject/.template.config/ide.host.json +++ b/build/templates/UmbracoProject/.template.config/ide.host.json @@ -55,6 +55,13 @@ "text": "Optional: Database connection string when using Unattended install" }, "isVisible": "true" + }, + { + "id": "NoNodesViewPath", + "name": { + "text": "Optional: Path to a custom view presented with the Umbraco installation contains no published content" + }, + "isVisible": "true" } ] } diff --git a/build/templates/UmbracoProject/.template.config/template.json b/build/templates/UmbracoProject/.template.config/template.json index 8414c5eeb3..fa92b73969 100644 --- a/build/templates/UmbracoProject/.template.config/template.json +++ b/build/templates/UmbracoProject/.template.config/template.json @@ -249,6 +249,43 @@ ] } }, + "NoNodesViewPath":{ + "type": "parameter", + "datatype":"text", + "description": "Path to a custom view presented with the Umbraco installation contains no published content", + "defaultValue": "", + }, + "NoNodesViewPathReplaced":{ + "type": "generated", + "generator": "regex", + "dataType": "string", + "replaces": "NO_NODES_VIEW_PATH_FROM_TEMPLATE", + "parameters": { + "source": "NoNodesViewPath", + "steps": [ + { + "regex": "\\\\", + "replacement": "\\\\" + }, + { + "regex": "\\\"", + "replacement": "\\\"" + }, + { + "regex": "\\\n", + "replacement": "\\\n" + }, + { + "regex": "\\\t", + "replacement": "\\\t" + } + ] + } + }, + "HasNoNodesViewPath":{ + "type": "computed", + "value": "(NoNodesViewPath != \"\")" + }, "UsingUnattenedInstall":{ "type": "computed", "value": "(FriendlyName != \"\" && Email != \"\" && Password != \"\" && ConnectionString != \"\")" diff --git a/build/templates/UmbracoProject/appsettings.Development.json b/build/templates/UmbracoProject/appsettings.Development.json index 59b6882a6b..e305e095ce 100644 --- a/build/templates/UmbracoProject/appsettings.Development.json +++ b/build/templates/UmbracoProject/appsettings.Development.json @@ -34,6 +34,9 @@ }, //#endif "Global": { + //#if (HasNoNodesViewPath) + "NoNodesViewPath": "NO_NODES_VIEW_PATH_FROM_TEMPLATE", + //#endif "Smtp": { "From": "your@email.here", "Host": "localhost",