Skip to content

Commit 5c2d712

Browse files
committed
Touching up the documentation. A doc type with the name "404" is not allowed by the CMS.
1 parent da7b5e6 commit 5c2d712

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

14/umbraco-cms/tutorials/custom-error-page.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,19 @@ This method will use a 404 page created via the backoffice.
3636

3737
1. Navigate to the **Settings** section.
3838
2. Create a new "_Document Type with Template_".
39-
3. Name the Document Type **404**.
39+
3. Name the Document Type **404 Page**.
40+
1. Note: By default, Umbraco will generate the alias for this DocType as simply "Page," omitting the "404." You may want to manually adjust the alias to "404Page."
4041
4. \[Optional] Add properties on the Document Type.
4142
1. In most cases, the 404 not found page would be static.
4243
5. Fill out the Template with your custom markup.
4344
6. Create another **Document Type**, but create it without the Template.
4445
7. Call this Document Type **Statuscodes**.
4546
8. Open the **Structure** Workspace view.
4647
9. Check the **Allow at root** option.
47-
10. Add the **404** Document Type as an **Allowed child note type**.
48+
10. Add the **404 Page** Document Type as an **Allowed child note type**.
4849
11. Navigate to the **Content** section.
4950
12. Create a **Statuscodes** content item called **Statuscodes**.
50-
13. Create a **404** content item under the **Statuscodes** content.
51+
13. Create a **404 Page** content item under the **Statuscodes** content.
5152

5253
### Set a custom 404 page in the configuration
5354

@@ -116,7 +117,7 @@ public class Error404Page : IContentLastChanceFinder
116117

117118
// Find the first notFound page at the root level through the published content cache by its documentTypeAlias
118119
// You can make this search as complex as you want, you can return different pages based on anything in the original request
119-
var notFoundPage = umbracoContext.Content?.GetAtRoot().FirstOrDefault(c => c.ContentType.Alias == "Page404");
120+
var notFoundPage = umbracoContext.Content?.GetAtRoot().FirstOrDefault(c => c.ContentType.Alias == "404Page");
120121
if (notFoundPage == null)
121122
{
122123
return Task.FromResult(false);

0 commit comments

Comments
 (0)