Thursday, November 17, 2011

Sitecore Item default fieldname

Hi Sitecore Devs,

Just thought of sharing the list of Sitecore item default field name (see the imagess below). I believe you can find the listing in a page or pdf somewhere in SDN, but it could be hard to find.

Anyway, if for example you would like to retrieve an item "created by" value

You can do so by

Var createdBy = Sitecore.Context.Item[“__created by”];

Or

Var createdBy = Sitecore.Context.Item[Sitecore.Data.Fields.FieldIDs.CreatedBy];

The later approach by using Sitecore.Data.Fields.FieldIDs. is neater however it does not list the full Sitecore item default field name.



No comments:

Post a Comment