I have looked through the documentation and tutorials on the Glass Mapper site, but I can't find a list of the different attributes that are available and what they do.
1 Answer
SitecoreChildrenAttribute
- Maps children of the current item. Expects anIEnumerable<T>
SitecoreFieldAttribute
- Maps from a field on the current itemSitecoreFieldFieldValueAttribute
- Used to populate default values of a field's fieldSitecoreIdAttribute
- Maps the Sitecore item ID. Expects the property to be aSitecore.Data.ID
orGuid
SitecoreIgnoreAttribute
- Ignores the property and doesn't map anything.SitecoreInfoAttribute
- Maps from various item properies according to the providedSitecoreInfoType
parameter which can have the following values:ContentPath
- The item's content path. The property type must beSystem.String
DisplayName
- The item's display name. The property type must beSystem.String
FullPath
- The item's full path. The property type must beSystem.String
Key
- The item's key. The property type must beSystem.String
ItemUri
- The item's ItemUri . The property type must beSitecore.Data.ItemUri
MediaUrl
- The item's media URL. The property type must beSystem.String
Path
- The item's path. The property type must beSystem.String
TemplateId
- The item's template Id. The property type must beSystem.Guid
TemplateName
- The item's template name. The property type must beSystem.String
Url
- The item's URL. The property type must beSystem.String
Version
- The item's version. The property type must beSystem.Int32
Name
- The item's Name. The property type must beSystem.String
Language
- The items language. The property type must beSitecore.Globalization.Language
BaseTemplateIds
- Gets the Base Template IDs - does not return the template is. The property type must beIEnumerable<Guid>
SitecoreItemAttribute
- Maps the context itemSitecoreLinkedAttribute
- Maps references using theLinkDatabase
. Expects anIEnumerable<T>
SitecoreNodeAttribute
- Maps the item specified by the provided Id or Path parameterSitecoreParentAttribute
- Maps the parent of the current itemSitecoreQueryAttribute
- Maps the results of a Sitecore Query. Expects anIEnumerable<T>
. See the official tutorial for details.SitecoreSelfAttribute
- Maps the current model item. Typically used to map a template section to a different model for easier reuse.
Most of this info was found by reading the source code and comments on Github