Tuesday, May 8, 2012

Adding Created By / Author into XSLT

Trying to display the Created By or Date Modified in your XSL transform in something like a DataFormWebPart?  The ol'
<xsl:value-of select="@Author"/>
won't do the trick.  But you can use a custom template in the CreateModifiedInfo control to display what you'd like:
<SharePoint:CreatedModifiedInfo ControlMode="Display" runat="server">
<CustomTemplate>
      Posted By:  <SharePoint:FormField FieldName="Author" runat="server" ControlMode="Display" DisableInputFieldLabel="true" />
</CustomTemplate>
</SharePoint:CreatedModifiedInfo>