Skip to content

Commit 4c1f28a

Browse files
authored
Update 13/umbraco-cms/reference/routing/custom-routes.md
1 parent ea25591 commit 4c1f28a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

13/umbraco-cms/reference/routing/custom-routes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public IPublishedContent FindContent(ActionExecutingContext actionExecutingConte
214214
}
215215
```
216216

217-
We start off by getting our product root using the `UmbracoContext` to get it based off its id. Next we need to figure out what action is being requested. To do this we cast the `actionExecutingContext.ActionDescriptor` to a `ControllerActionDescriptor` and use its `ActionName` property. If the action name is index, we return the product root. If it's product, we try to get the SKU from the route value `id`. Then we try to find the child node which matches the SKU and return that.
217+
Start by retrieving the product root using the `UmbracoContext` to obtain it based on its ID. Next, let's figure out what action is being requested. To do this, cast the `actionExecutingContext.ActionDescriptor` to a `ControllerActionDescriptor` and use its `ActionName` property. If the action name is index, it returns the product root. If it's a product, we get the SKU from the route value `id` and find the matching child node.
218218

219219
There's only one last thing to do. We need to register our shop controller. If you're creating a controller for your own site you can do it in the `Program.cs` like so:
220220

0 commit comments

Comments
 (0)