This project is read-only.

How do I get the content part by url with AutoRoute?

Topics: Writing modules
Mar 7, 2012 at 3:46 PM


Got into the trouble after upgrade to 1.4.

It was easy to get the content item by querying the RoutePart by Path property. How do I het Content part by url in 1.4 with AutoRoute?

Mar 7, 2012 at 5:41 PM

IAliasHolder. Or IAutoroutePathContraint. 

Mar 9, 2012 at 8:26 AM

Thank you for pointing out the aliases. Unfortunatelly I didn't find the IAutoroutePathContraint class. It seems t

But I've managed to convert the path into RouteValueDictionary with help of IAliasService.Get. Basically this codepart converts the path into two ways:


I'm even able to get VirtualPathData out of _aliasService.LookupVirtualPaths

But, I still stuck by getting the ContentItem out of the path nor RouteValueDictionary.

Mar 9, 2012 at 9:08 AM

Ok, looks like I'm one the right way looking into AutoRoputePart record.

            var routeRecord = _contentManager.Query<AutoroutePartAutoroutePartRecord>()
                .Where(part => part.DisplayAlias != null && part.DisplayAlias.StartsWith(returnUrl))