Adding fields to content parts

Topics: Customizing Orchard
Feb 21, 2012 at 7:22 AM

Why are LinkField, EnumerationField etc field options not available when fields are added to parts? 

I've been adding them to parts & wondering where the options referred to in the code are getting set.  I just discovered them when adding a field to a content type.

Coordinator
Feb 21, 2012 at 7:47 AM

Add them to a part that has the same name as the content type.

Feb 21, 2012 at 8:39 PM

Sorry, maybe I didn't phrase my question properly :-) In the admin UI, if I add a link field to a content part, the field is added & any content type that has that part that I create contains the field, through the attached part.  Everything works, except there are no options. 

If the part has the same name as the type it's attached to, the result is the same.

Is this a bug or by design? 

Coordinator
Feb 22, 2012 at 12:42 AM

Looks like a bug.

Coordinator
Feb 22, 2012 at 12:53 AM

This is by design, and let me add that this is a wonderful design ! Actually settings are defined at the content type level, which means that if you edit the content type, you will be able to find the settings of the fields by editing the attached part. It beautiful because then you can reuse parts, but define custom settings every time it is used on a different content type. 

Coordinator
Feb 22, 2012 at 12:56 AM

But the settings *dont appear* in the editor is what planetClaire is saying if I understood correctly.

Feb 22, 2012 at 1:01 AM

oh, I see that now, yes I like it it's wonderful allright :-)  BUT I think we need some guidance somewhere, like when adding fields to a part, can we please be informed that we need to set the options in the type?

Feb 22, 2012 at 1:02 AM
bertrandleroy wrote:

But the settings *dont appear* in the editor is what planetClaire is saying if I understood correctly.

They do, I found them in the type (which was User, I had a MemberPart attached with the fields).  I hadn't thought to look in the User type.

Coordinator
Feb 22, 2012 at 1:07 AM

Ah, OK, I misunderstood then. And Sébastien is annoying as usual, being right and everything.