Jun 26, 2013 at 2:31 PM
Edited Jun 26, 2013 at 2:35 PM
I have created a controller and Item action for my own Course content type which overwrites the functionality of the default ItemController Display action. Because I want a bit more control over the displaying of a Course.
The only difference between my Item action and the Display action is that the Display action receives the ID for the content item as a parameter to view and my Item action gets the URL path as a parameter.
I do not know how the ItemController gets the ID for the content item from the URL path - something happens before the Display action is hit but I do not know what - maybe someone can explain this?
So as I just have the URL path, I do this to return the ContentItem from the path
.Where<AutoroutePartRecord>(a => a.DisplayAlias != null && a.DisplayAlias == autoRouteDisplayAlias)
This query does return me a contentItem, but will it always return the most recent version of the correct one?
I ask because I have recently been looking into the AliasPart and I am confused as to how the AliasPart and the AutoroutePart differ when getting a contentitem from it's route - can anyone help?