Skip to content

Commit 16d5674

Browse files
authored
Update 15/umbraco-cms/reference/routing/custom-routes.md
1 parent c4032ec commit 16d5674

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

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

216-
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.
216+
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.
217217

218218
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:
219219

0 commit comments

Comments
 (0)