What is the correct path to a view for setting the NoNodesViewPath?

Hello :wave:
So I am working on an Umbraco 13.5.3 site and I want to set/customize the built in Umbraco No Nodes default view/template, but I am having no luck when I try to set the AppSetting.

Example of a No Nodes View

Docs

The docs are very lacking and do not give much information about the setting and if any certain directories or path types should be used?

Question

So where should I place the view, should it live in the /views folder at /views/custom-no-nodes.chtml and then set the AppSetting key as follows?

I have tried this and various different URL approaches without luck, so I wanted to see if anyone knew what my problem could be?

{
  "$schema": "./appsettings-schema.json",
  ...

  "Umbraco": {
    "CMS": {
      "Global": {
        "NoNodesViewPath": "/views/no-nodes-custom.cshtml",
        ...
      }
    }
  }
}

Why?

Well for this particular instance I am working on, it is being used purely as an API endpoint and does not contain any pages that have a template assigned to them, and I would prefer to have just a simple message or page saying the project rather than the default Umbraco no nodes page.

On a Cloud project (v13 as well) I have it set as:

"NoNodesViewPath": "~/umbraco/UmbracoWebsite/Deploy/NoNodes.cshtml",

So I think the ~ might matter, not sure if you tried that?

I tried the following @sebastiaan
~/views/CustomNoNodes.cshtml

Trying ~/views/CustomNoNodes.cshtml not working

I even tried the exact same path as you with no luck.
~/umbraco/UmbracoWebsite/Deploy/NoNodes.cshtml

I am off to try it out in a clean install of this specific version of Umbraco 13.5.3 to see if its a bug or not…

OK this is me being an idiot!
This works just fine when you do indeed have no content nodes in your site and a view at Views/CustomNoNodes.cshtml works just fine if you set the path to ~/Views/CustomNoNodes

As soon as I add a content node and even if the doctype does not have a template set to it. The No nodes view goes away and the 404 Umbraco built in error displays.

It’s clearly been a looooong week.

Face Palm Cookie Monster

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.