Mar 5, 2012 at 5:54 AM
Edited Mar 5, 2012 at 5:55 AM
The old RoutePart had a great feature that could be used in recipes or import/export where the RoutePart detected and appropriately set a bool as part of the RoutePart export xml if the content type was the home page.
With AutoRoute, the concept is there (somewhere).
I believe I have it exporting correctly by adding this code to the Exporting Method in AutoroutePartDriver.cs
// retrieve home page
var homepage = _aliasService.Get(string.Empty);
var displayRouteValues = _contentManager.GetItemMetadata(part).DisplayRouteValues;
Unfortunately I'm a bit over my head trying to get it to correctly import this elegantly but here is what I did on the import and it works.
This is based on code from the editor:
var promoteToHomePage = context.Attribute(part.PartDefinition.Name, "PromoteToHomePage");
if (promoteToHomePage != null)
part.DisplayAlias = "/";
Could someone help find the correct and elegant solution to this?