posts - 41, comments - 200, trackbacks - 0

My Links

News

These postings are provided "AS IS" with no warranties, and confers no rights.
Locations of visitors to this page virtusa corp sharepoint virtusa.com shehan peruma

Tag Cloud

Archives

Post Categories

Change the format of the 'Created By' field in a page layout

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"%> 

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Tuesday, December 23, 2008 4:13 AM | Filed Under [ MOSS Customization ]

Feedback

Gravatar

# re: Change the format of the 'Created By' field in a page layout

Hi, great post.
The only thing not working for me is that this control displays the author as a link. Do you know a way to show it as text only?
Thanks,
G
4/3/2009 6:12 PM | gbelzile
Gravatar

# re: Change the format of the 'Created By' field in a page layout

what all parameters can go for FieldName="", other than "Author"
10/21/2011 11:07 AM | ritesh
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: