To solve my previous question re. “Catch All Pages” I built a solution where I can add an attribute [CatchAllPageType] to the page type definitions of pages where I want “Catch all relative routing” and then the IPageNotFoundResolver when getting a 404 checks the paths to determine whether it should render a page.
The question I have now, If I need to pass additional data over to the controller/view via PageNotFoundResolver is there something I can use on PageRequestData? It has a Data property with no documentation that I can find. Is that useable somehow?
Use the PageRequestData.NamedData to pass data that you need. The PageRequestData.Data is used for product page types to pass the ProductPageData so the controllers know what category/product that should be rendered.
Btw, I’m interesting to hear the reason to not use the INamedHandlerRouteResolver that already exists in the product and instead build an own solution?
@patric.forsgard to be honest, we already had something solving another thing (in a way similar) we needed implemented in the not found resolver.
I needed it on four different page types, and your answer to my previous question made me feel that your proposed solution wasn’t really meant for this… but I can “try” it?
I can obviously change to making a “plugin” and “INamedHandlerRouteResolver”.
Scratch that. Your solution with INamedHandlerRouteResolver can only be used on one page type. So I would need to duplicate that class per page type.
@patric.forsgard I changed to having four different INamedHandlerRouteResolvers, that inherits from a common implementation. But I’ve tried for a while to understand HOW to get the values out that I assign to PageRequestData, but it always seem to be a “new” instance (when being assigned via dependency injection). How can I get the data extracted?