This project is read-only.

Help accessing fields attached to Layout content type

Topics: General
Oct 5, 2013 at 9:45 AM
Anyone able to give some guidance on how to access fields attached to a Layout content type from within a view. I have added an input field called "Script" and need to access it within views.
Oct 5, 2013 at 11:36 AM
Edited Oct 5, 2013 at 11:37 AM
The syntax is as follows: <content item>.<part name>.<field technical name>. If you attached a field directly to the type (not to some existing part), the <part name> is equal to your type name.

So provided your content item is available through Model.ContentItem property, you can access your field via Model.ContentItem.Layout.Script.