File element

Applies to: Lync 2013 | Lync Server 2013 | SharePoint 2016 | SharePoint Foundation 2013 | SharePoint Online | SharePoint Server 2013

Specifies a file to include within a module in a site definition configuration or Web template configuration.

<File
  DocumentTemplateForList = "Text"  DoGUIDFixUp = "TRUE" | "FALSE"
  IgnoreIfAlreadyExists = "TRUE" | "FALSE"
  Level = "Text"
  Name = "Text"
  NavBarHome = "TRUE" | "FALSE"
  Path = "Text"
  Type = "Text"
  Url = "Text >
</File>

Elements and attributes

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description
DocumentTemplateForList
Optional Text.
DoGUIDFixUp
Optional Boolean.
IgnoreIfAlreadyExists
Optional Boolean.
Level
Optional Text.
Name
Optional Text. Specifies the virtual path for the file. Cannot contain the following characters:
"
#
%
&
*
:
<
>
?
\
{
}

~
\x7f
NavBarHome
Optional Boolean. TRUE if the file is the destination URL for the Home link in the top navigation bar used throughout the site.
Path
Optional Text. Specifies the physical path to the file relative to %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\SiteTemplates\ Site_Definition for Onet.xml files. Specifies the physical path to the file relative to %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\FEATURES\ Feature_Name for Feature.xml files. Can only contain the following characters:
alphanumeric
hyphen (-)
underscore (_)
period (.)
space ( )
Type
Optional Text. Specifies that the file be cached in memory on the front-end server. Possible values include Ghostable and GhostableInLibrary. Both values specify that the file will be cached, but GhostableInLibrary specifies that the file will be cached as part of a list whose base type is Document Library.

For example, when changes are made to a home page through the user interface (UI), only the differences between the original page definition and the new page are stored in the database. The default.aspx is cached in memory, in addition to the schema files. The HTML page that is displayed in the browser is constructed through the combined page definition that results from the original page definition that is cached in memory and from changes that are stored in the database.
Url
Required Text. Specifies the virtual path for the file. If the Name attribute is specified, its value is used for the virtual path. If Path is not specified, the value of Url is used for the physical path. Cannot contain the following characters:
"
#
%
&
*
:
<
>
?
\
{
}

~
\x7f

Child elements

Parent elements

Occurrences

  • Minimum: 0
  • Maximum: Unbounded

Remarks

For an example that uses the File element, see Module element (Site).