Wednesday, September 10, 2014

Working With Sitecore Developer Types Fields

ICON: The Icon field type associates a themed icon with each item.  "/~/icon/" should be prefixed to render the icon.

Sitecore.Data.Fields.Field iconField = current.Fields ["Icon Field"];
Image1.ImageUrl = "/~/icon/" + iconField.Value;

IFRAME: The IFRAME field type display a web page within a field. The source property of the field specifies the URL to display.

Tristate: The Tristate field type allows the user to select one of the three options: Default, Yes and No. If the user selects Default, the value of the field would be empty string. If the user selects Yes, the value would be number 1. If the user selects No, the value would be number 0.

Sitecore.Data.Fields.ValueLookupField tristateField = current.Fields ["Tristate Field"];

ltPageData.Text = tristateField.Value;

No comments:

Post a Comment