Export (0) Print
Expand All

Limit Element

SharePoint Team Services 1.1

The Limit element truncates text to a specified size.

Syntax

<Limit
  AutoHyperLink = "TRUE" | "FALSE"
  AutoNewLine = "TRUE" | "FALSE"
  HTMLEncode = "TRUE" | "FALSE"
  Len = "Integer"
  MoreText = "Text"
  StripWS = "TRUE" | "FALSE">
</Limit>

Attributes

NameDescription
AutoHyperLinkOptional Boolean. TRUE if <A> tags are added to text if it looks like a hyperlink.
AutoNewLineOptional Boolean. TRUE if <BR> tags are inserted into the text stream and multiple spaces are replaced with non-breaking spaces.
HTMLEncodeOptional Boolean. Converts embedded characters so that they are displayed as text in the browser. In other words, characters that could be confused with HTML tags are converted to entities.
LenOptional Integer. Determines the maximum number of characters to show. The default value is 128.
MoreTextOptional Text. Specifies the text to append to the end of the returned string to indicate that its limit has been surpassed.
StripWSOptional Boolean. TRUE if white space is removed from the beginning and end of the value returned by the Column element.

Related Elements

Parent ElementsChild Elements
Else, RenderPattern, Then, ViewBodyColumn, GetVar, Property, ThreadStamp

Remarks

Note that Limit will not break words. For example, <ows:Limit Len=3>Microsoft Corporation</ows:Limit> returns Microsoft, not Mic.

Example

The following example limits the text of the Body field to 250 characters and puts an ellipsis ("...") after the string if it's cut off.

<Limit Len="250" MoreText="..." AutoHyperLink="TRUE" AutoNewLine="TRUE">
  <Column Name="Body"/>
</Limit>>

See Also

Universal Attributes for Page Rendering Elements


Show:
© 2014 Microsoft