Newer Version Available
CustomSite
Represents a Force.com site. Force.com
Sites enables you to create public
websites and applications that are directly integrated with your Salesforce organization—without
requiring users to log in with a username and password. For more information, see “Force.com Sites Overview” in the Salesforce online
help.
This type extends the Metadata
metadata type and inherits its fullName field.
Declarative Metadata File Suffix and Directory Location
Force.com CustomSite components are stored in the sites directory of the corresponding package directory. The file name matches the site name, and the extension is .site.
Version
Force.com CustomSite components are available in API version 14.0 and later.
Fields
SiteRedirectMapping
SiteRedirectMapping represents a URL redirect rule on your Force.com site. For more information, see “Force.com Sites URL Redirects” in the Salesforce online help.
| Field | Field Type | Description |
|---|---|---|
| action | SiteRedirect (enumeration of type string) | The type of the redirect. Available string values are:
|
| isActive | boolean | The status of the redirect: active or inactive. |
| source | string | The URL that you want to redirect. It must be a relative URL, but can have any valid extension type, such as .html or .php. |
| target | string | The new URL you want users to visit. It can be a relative URL or a fully-qualified URL with an http:// or https:// prefix. |
SiteWebAddress
Represents the web address of a Force.com site.
| Field | Field Type | Description |
|---|---|---|
| certificate | string | Although this field is visible in the Metadata API version 37.0, it’s not functional and should be left blank. |
| domainName | string | The domain of the website, in the form of www.acme.com. |
| primary | boolean | Indicates whether this is the primary domain (true). If false, this is not the primary domain. |
Declarative Metadata Sample Definition
A sample XML definition of a site is shown below.
1<?xml version="1.0" encoding="UTF-8"?>
2<CustomSite xmlns="http://soap.sforce.com/2006/04/metadata">
3 <active>true</active>
4 <allowHomePage>true</allowHomePage>
5 <allowStandardIdeasPages>true</allowStandardIdeasPages>
6 <allowStandardLookups>true</allowStandardLookups>
7 <allowStandardSearch>true</allowStandardSearch>
8 <authorizationRequiredPage>Unauthorized</authorizationRequiredPage>
9 <bandwidthExceededPage>BandwidthExceeded</bandwidthExceededPage>
10 <changePasswordPage>ChangePassword</changePasswordPage>
11 <chatterAnswersForgotPasswordConfirmPage>ChatterAnswersForgotPasswordConfirm</chatterAnswersForgotPasswordConfirmPage>
12 <chatterAnswersForgotPasswordPage>ChatterAnswersForgotPassword</chatterAnswersForgotPasswordPage>
13 <chatterAnswersHelpPage>ChatterAnswersHelp</chatterAnswersHelpPage>
14 <chatterAnswersLoginPage>ChatterAnswersLogin</chatterAnswersLoginPage>
15 <chatterAnswersRegistrationPage>ChatterAnswersRegistration</chatterAnswersRegistrationPage>
16 <clickjackProtectionLevel>SameOriginOnly</clickjackProtectionLevel>
17 <customWebAddresses>
18 <domainName>www.testing123.com</domainName>
19 <primary>true</primary>
20 </customWebAddress>
21 <favoriteIcon>myFavIcon</favoriteIcon>
22 <fileNotFoundPage>FileNotFound</fileNotFoundPage>
23 <genericErrorPage>Exception</genericErrorPage>
24 <inMaintenancePage>InMaintenance</inMaintenancePage>
25 <serverIsDown>MyServerDownResource</serverIsDown>
26 <indexPage>UnderConstruction</indexPage>
27 <masterLabel>customSite</masterLabel>
28 <portal>Customer Portal</portal>
29 <requireInsecurePortalAccess>false</requireInsecurePortalAccess>
30 <siteAdmin>admin@myco.org</siteAdmin>
31 <siteTemplate>SiteTemplate</siteTemplate>
32 <subdomain>myco</subdomain>
33</CustomSite>