Skip to content

Commit 22f72d6

Browse files
committed
Implementing suggestions from code review!
1 parent 5c2d712 commit 22f72d6

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +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 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."
41-
4. \[Optional] Add properties on the Document Type.
39+
3. Name the Document Type **404**.
40+
4. Before saving the Document Type, adjust the alias to "Page404." Umbraco will not allow you to create a Document Type with a numeric alias.
41+
5. \[Optional] Add properties on the Document Type.
4242
1. In most cases, the 404 not found page would be static.
43-
5. Fill out the Template with your custom markup.
44-
6. Create another **Document Type**, but create it without the Template.
45-
7. Call this Document Type **Statuscodes**.
46-
8. Open the **Structure** Workspace view.
47-
9. Check the **Allow at root** option.
48-
10. Add the **404 Page** Document Type as an **Allowed child note type**.
49-
11. Navigate to the **Content** section.
50-
12. Create a **Statuscodes** content item called **Statuscodes**.
51-
13. Create a **404 Page** content item under the **Statuscodes** content.
43+
6. Fill out the Template with your custom markup.
44+
7. Create another **Document Type**, but create it without the Template.
45+
8. Call this Document Type **Statuscodes**.
46+
9. Open the **Structure** Workspace view.
47+
10. Check the **Allow at root** option.
48+
11. Add the **404 Page** Document Type as an **Allowed child note type**.
49+
12. Navigate to the **Content** section.
50+
13. Create a **Statuscodes** content item called **Statuscodes**.
51+
14. Create a **404 Page** content item under the **Statuscodes** content.
5252

5353
### Set a custom 404 page in the configuration
5454

@@ -117,7 +117,7 @@ public class Error404Page : IContentLastChanceFinder
117117

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

0 commit comments

Comments
 (0)