RenderPattern Element

The RenderPattern element is used in FLDTYPES.XML to provide field definition when a field is being declared in a list schema, or when a piece of data is being rendered.

Syntax

<RenderPattern
  DisplayName = "Text"
  Name = "NewPattern"
  Type = "DataType">
</RenderPattern>

Attributes

Name Description
DisplayName Required Text. The displayed name of the field.
Name The Name attribute specifies what display mode this CAML is used in. The following table presents possible values for this attribute, their display modes, and when they are in effect.
DisplayPattern DISPLAY when rendering the ViewBody section of a view.
EditPattern EDIT when rendering an edit item form.
HeadPattern DISPLAYHEAD when rendering the ViewHeader section of a view.
NewPattern NEW when rendering a new item form.
PreviewDisplayPattern PREVIEWDISPLAY when editing a display form with Microsoft FrontPage.
PreviewNewPattern PREVIEWNEW when editing a new item form with FrontPage.
PreviewEditPattern PREVIEWEDIT when editing an edit item form with FrontPage.
DisplayPattern DISPLAY when rendering the ViewBody section of a view.
EditPattern EDIT when rendering an edit item form.
HeadPattern DISPLAYHEAD when rendering the ViewHeader section of a view.
NewPattern NEW when rendering a new item form.
PreviewDisplayPattern PREVIEWDISPLAY when editing a display form with Microsoft FrontPage.
PreviewNewPattern PREVIEWNEW when editing a new item form with FrontPage.
PreviewEditPattern PREVIEWEDIT when editing an edit item form with FrontPage.
Type Optional. Specifies a data type for the rendered pattern. Can be set to one of the following types used in FLDTYPES.XML: Boolean, Choice, Counter, Currency, DateTime, Integer, Lookup, Note, Number, Text, Threading, URL.
Parent Elements Child Elements
Fields, Row Column, FieldFilterImageURL, FieldPrefix, ForEach, HTML, HttpHost, HttpVDir, Limit, LookupColumn, Property, ScriptQuote, SelectOptions, Switch, URL, UrlBaseName

Remarks

When the Field element is used to request the rendering of a piece of data, the rendering works as follows:

  1. Which field being rendered is determined. If rendering takes place inside a Fields or ForEach element (for example, <ForEach Select="/Fields/Field"> enumeration, it will be whatever comes next in the enumeration. Otherwise, the field can be specified as <Field Name="FieldName"/>.
  2. The data type of the field in question is determined (for example, Text, Number, Currency, etc.).
  3. The display mode is determined, which can be one of the seven modes listed for the Name attribute in the above table.
  1. FLDTYPES.XML is consulted for the CAML appropriate to the particular display mode and data type.
  2. The CAML found in FLDTYPES.XML is rendered.

For example, assume that a Text field is being rendered in Edit mode. The section in FLDTYPES.XML that describes the Text type is consulted, and then the CAML contained in <RenderPattern Name="EditPattern"> is rendered.

It's not recommended, but you can edit FLDTYPES.XML in order to change, for example, how integer data is displayed. This will affect all Web sites based on SharePoint Team Services from Microsoft after Microsoft Internet Information Services (IIS) is restarted.

Example

The following excerpt from FLDTYPES.XML defines hidden input for a new item form.

<RenderPattern Name="NewPattern" DisplayName="NewPattern">
  <HTML>
    <![CDATA[ <INPUT TYPE=HIDDEN NAME=" ]]>
  </HTML>
  <FieldPrefix />
  <Property Select="Name" />
  <HTML>" VALUE="</HTML> 
  <Switch StripWS="TRUE">
    <Expr>
      <GetVar Name="Guid" StripWS="TRUE" />
    </Expr>
    <Case Value="">
      <GUID />
    </Case>
    <Default>
      <GetVar Name="Guid" StripWS="TRUE" />
    </Default>
  </Switch>
  <HTML><![CDATA[ ">  ]]></HTML>
</RenderPattern>

See Also

Field