Quantcast
Channel: The Oszakiewski Family » SharePoint
Viewing all articles
Browse latest Browse all 16

Manage Created & Modified info on custom form in XSLT

$
0
0

Just wanted to write this down so I don’t forget how to do this, if this helps someone else out even better!

If you’re wanting to access the Created By, Created On, Modified By and Modified on information on a custom list form in SharePoint 2010 or 2013, you can do this using the SharePoint:CreatedModifiedInfo control and use the CustomTemplate element, like so:

<SharePoint:CreatedModifiedInfo ControlMode="Display" runat="server"> 
    <CustomTemplate> 
        <SharePoint:FormField FieldName="Author" runat="server" ControlMode="Display" DisableInputFieldLabel="true" />
        <SharePoint:FieldValue FieldName="Created" runat="server" ControlMode="Display" DisableInputFieldLabel="true"/> 
        <SharePoint:FormField FieldName="Editor" runat="server" ControlMode="Display" DisableInputFieldLabel="true" />
        <SharePoint:FieldValue FieldName="Modified" runat="server" ControlMode="Display" DisableInputFieldLabel="true"/>
    </CustomTemplate> 
</SharePoint:CreatedModifiedInfo>

SharePoint uses the field names Author, Created, Editor and Modified to refer to the following:

Author: Created by
Created: Date Created
Editor: Modified by
Modified: Date last modified

You can include any combination of these fields and any other HTML/CSS to adjust the layout as needed either inside or outside of the CreatedModifiedInfo control. If you want to separate out the fields into separate areas of the page, you will need to repeat the control pattern of SharePoint:CreatedModifiedInfo->CustomTemplate->FormField for each section.

Hope this helps!


Viewing all articles
Browse latest Browse all 16

Trending Articles