ContentPart set Path in Orchard 1.4

Topics: Troubleshooting
Apr 26, 2012 at 1:49 PM

Hello all,

i'm in a project that was build on Orchard 1.3  and we had our own CommandHandler inherited from DefaultOrchardCommandHandler.

I know RoutePart is now gone, AutoroutePart took it's place..

We had a little piece of code in the Create method:

 var owner = _membershipService.GetUser(Owner);

 var page = _contentManager.Create("Page", VersionOptions.Draft);

 page.As<TitlePart>().Title = Title;
 page.As<RoutePart>().Path = Path;
 page.As<RoutePart>().Slug = Slug;
 page.As<RoutePart>().PromoteToHomePage = Homepage;
 page.As<ICommonPart>().Owner = owner;

I can't seem to figure out what to do here now in 1.4
If I change RoutePart to AutoroutePart, I can't set the Path anymore because it is readonly...
Also Slug is readonly...

Can someone point me in the right direction here? Because I'm a little clueless.



Apr 26, 2012 at 5:57 PM