This project is read-only.

Configuring Field properties in Content Part

Topics: Customizing Orchard, General
Mar 2, 2012 at 2:12 AM
Edited Mar 2, 2012 at 2:12 AM

With the arrival of Orchard 1.4 and the introduction of the new Field Types, I'm wondering if it makes sense to start allowing editing the custom field properties in the Content Part. At the moment, if I want to configure the properties of a Custom Field in the Admin UI, then I'm forced to add this field to the Content Type.

Mar 2, 2012 at 4:55 PM

Unless I misunderstand your question, you can already add fields to content parts. Actually you can only add fields to content parts, even when you think it's been added to a content type.

Mar 2, 2012 at 5:09 PM
Edited Mar 2, 2012 at 5:33 PM

Actually, I meant modifying the "settings" (Hint, Required, Scale, Min, Max.. etc) of the different fields types  (which is saved into the Settings_ContentPartFieldDefinitionRecord table in Orchard1.4). Currently, in the Admin UI, you can do that only if you add the fields to a Content Type.

I even tried to add the field to a Content Part, then to go to its record in Settings_ContentPartFieldDefinitionRecord and manually add settings to it, but that doesn't seem to have any effect, the settings will work only if the Field is attached to a Content Type.

Mar 2, 2012 at 6:17 PM

When you change the db, do you restart the webserver ? Those values are cached.

Mar 2, 2012 at 7:31 PM

Sebastien, that was brilliant, I completely forgot about caching, and once I restarted the iis, the manual changes I made in Settings_ContentPartFieldDefinitionRecord were reflected in the UI.

Now, the question is, not being able to modify custom field settings in the ContenPart, is it by design, or is it a bug?

Mar 2, 2012 at 7:41 PM

You can change the settings on the content type where the part is attached. Not on the content part itself, because every time you attach a part to a content type, you need to be able to change the settings. So, go edit the Content Type itself, expand its parts, and you will see the settings for the fields here.

Mar 2, 2012 at 7:51 PM
Edited Mar 2, 2012 at 7:53 PM

sometimes things are in front our eyes and we refuse to see them. All the while I was looking in the Fields section in the Content Type, and never realizing that that the ContentPart is actually expandable. Thanks for all the help. Orchard ROCKS.