I was creating a custom page layout for a publishing site and one of the requirements was to display the 'Created By' field. Piece of cake, I thought, all I need to do was to all add the following:
<SharePointWebControls:TextField FieldName="Created_x0020_By" runat="server"/>
However, this resulted in the field being rendered in the format- 'domain\username'. But on the 'View Properties' (DispForm.aspx) for the page the Created By field shown at the bottom of the page is in the correct format -'FirstName LastName'.
After some experimenting and researching this is the tag I had to use to get the correct format:
<SharePoint:FormField ID="FormField1" ControlMode="Display" FieldName="Author" DisableInputFieldLabel="true" runat="server"/>
Note: the 'SharePoint' tag prefix for the above maps to:
<%@Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.WebControls"%>