Custom Content Type with custom content part and Empty List

Topics: Customizing Orchard
Oct 29, 2012 at 11:20 PM

Hi,

 

I've created 2 content parts and 2 content type each one  contains a custom content part. After Create Table, in migration file I wrote:

 

 ContentDefinitionManager.AlterPartDefinition(typeof(PersonaPart).Name, cfg => cfg.Attachable());
ContentDefinitionManager.AlterPartDefinition( typeof(ReggimentoPart).Name, cfg => cfg.Attachable());
ContentDefinitionManager.AlterTypeDefinition("Persona", cfg => cfg                .WithPart("PersonaPart").WithPart("BodyPart").Creatable()            .Draftable()                );           

ContentDefinitionManager.AlterTypeDefinition("Reggimento", cfg => cfg                .WithPart("ReggimentoPart").WithPart("BodyPart").Creatable().Draftable()                                );

When I create a new Item of my custom types the table data are populated correctly, but my List Items is still empty. I don't find in any place populated data, through I insert Route path. Do you have any Idea?

 

Thank you very much.

Developer
Oct 29, 2012 at 11:59 PM

So you're saying that when you create a new content item of type Persona and Reggimento using the admin , these items don't show up when you list your content items? Perhaps try it again after attaching the CommonPart. If that still doesn't work, start by try and create a really simple content type, e.g. just with a TitlePart and BodyPart and see what happens.

Oct 30, 2012 at 2:53 PM

Yes I see inserted data in MyModule_Tables but I don't have any way to access them. I've tried with RoutePart with a custom route but it doesn't work. If I give a page to content type orchard shows me a content not found. Very strange

I will try with Common part and I'll tell you what it happens. Thank you very much for your precious help.

Oct 31, 2012 at 1:56 PM
Edited Oct 31, 2012 at 1:56 PM

I've tried with CommonPart, but If I active it, It goes in Exception (View passed data are of type ReggimentoPart), and I don't know Exactly what kind of data are passed with CommonPart Activated. Now I will try to restart with a more simple example. Thanks Anyway.

Coordinator
Oct 31, 2012 at 7:37 PM

You'll need to give more details than "it doesn't work" I'm afraid, such as exactly what you tried and how it fails.