Configuring a custom Footprint text field
Users can enter any string they want in a Footprint text field, but you can use regular expressions or a fixed set of values to restrict which values are valid, and you can set a minimum and/or maximum length.
Procedure
- Access your Content Manager server and navigate to %TRIDION_HOME%.
- Navigate to the subfolder web\WebUI\Models\SiteEdit\Configuration\.
- As a precaution, back up the file SiteEditModel.config.
- Open the file SiteEditModel.config in a plain-text or XML editor.
- Find the
customconfigurationsection. This section has a subsection calledclientconfiguration, which in turn contains afootprintssubsection.You see the list offootprintelements that represent the Footprints which are currently displayed in the Footprint Set dialogs. - Insert a new
footprintelement for the custom Footprint field you want to configure, and give it the following attributes:ID- a unique string that identifies this Footprint
ClaimUri-
the URI of a Claim associated with this Footprint, for example:
taf:claim:foo
- Insert a
<title>section inside your newfootprintelement. - For each language that your installation of SDL Web supports, insert a
valueelement inside thetitleelement, and give it alangattribute set to the four-digit Microsoft locale ID belonging to that language:1031for German1033for US English1036for French1041for Japanese1043for Dutch3082for Spanish
- Set the contents of each
valueelement to the localized name of this Footprint, as you want it to appear in the Footprint Settings dialog. - Also insert a
valueelement without alangattribute. This is used as a fallback if the language is none of the above. (If you do not insert such avalueelement, the value of theIDattribute of the parentfootprintelement is displayed.)You have now configured a title for your Footprint. - If you want, you can also write a description for your Footprint. The description appears under the title in the content area on the right if the user selects this Footprint. To create a Footprint description, insert a
<description>section inside your newfootprintelement, directly under the<title>section. - For each language that your installation of SDL Web supports, insert a
valueelement inside thedescriptionelement, and give it alangattribute set to the four-digit Microsoft locale ID belonging to that language. - Set the contents of each
valueelement to the localized description of this Footprint, as you want it to appear in the Footprint Settings dialog. - Also insert a
valueelement without alangattribute. This is used as a fallback if the language is none of the above. (If you do not insert such avalueelement, an empty string is displayed.)You have now configured a description for your Footprint. - If you want to disallow empty values for this field, insert a
<settings>section inside your newfootprintelement, and inside it, insert an<isMandatory>element containing the valuetrue. - If you want, you can specify a default value for the Footprint.
To specify a default value, insert a
<values>section inside thefootprintelement. Inside<values>, create avalueelement with the following attributes:text-
The value of the field, as it will be submitted. Set this attribute to the empty string (
text="") to make the empty value default. default-
Set this attribute to
true.
- For each language that your installation of SDL Web supports, insert a
labelelement inside thevalueelement, and give it alangattribute set to the four-digit Microsoft locale ID belonging to that language. - Set the contents of the
labelelement to the localized text that you want to use to represent the value. For example, if the value refers to the African continent, and thelabelhas alangattribute set to "1036" (France), then the contents oflabelwould beAfrique. - Also insert a
labelelement without alangattribute. This is used as a fallback if the language is none of the above. (If you do not insert such alabelelement, the value of thetextattribute of the parentvalueelement is displayed.)You have now configured a default value for your control. - Next, you can restrict the allowed values of this text field in one of the following ways:
- You can specify a regular expression for the text in the form of a
regExpelement inside the<settings>section (create this section if you have not done so yet). Set the value ofregExpto the regular expression that the input value should match. For example, to match only uppercase and lowercase letters, setregExpto^[A-Za-z]+$. - You can add a
valueelement for each of the allowed values, specifying atextattribute and a set oflabelsubelements, as you did for the default value. (For these new elements, omit thedefaultattribute.) This is only recommended if your set of allowed values is large; for smaller sets, useFootprintRadioorFootprintDropdowninstead.
- You can specify a regular expression for the text in the form of a
- If you want, repeat steps 5-19 to configure further custom Footprint fields that use a text field.
- Save and close SiteEditModel.config.
- Navigate to the subfolder web\WebUI\Editors\SiteEdit\Configuration\.
- As a precaution, back up the file SiteEditEditor.config.
- Open SiteEditEditor.config.
- Find the
customconfigurationsection. This section has a subsection calledclientconfiguration, which in turn contains afootprintssubsection.You see the list offootprintelements that represent the Footprints which are currently displayed in the Footprint Set dialogs. - Create an icon for the custom Footprint in the form of a set of PNG files named footprint.<iconname>.16x16.png (16 by 16 pixels), footprint.<iconname>.24x24.png (24 by 24 pixels), footprint.<iconname>.32x32.png (32 by 32 pixels) and footprint.<iconname>.48x48.png (48 by 48 pixes), where <iconname> is a name for your icon. Save these files in the folder %TRIDION_HOME%\web\WebUI\Editors\SiteEdit\Themes\Carbon\Images\Icons\.
- Add a new
footprintelement with the following attributes:ID- The identifier of the Footprint, as set in SiteEditModel.config.
ControlID-
Set this to
FootprintText. Icons- The name you provided for the icon (<iconname>).
- Repeat this step for each new Footprint you configured in SiteEditModel.config.
- Save and close SiteEditEditor.config.
- In the cd_ambient_conf.xml Ambient Data Framework configuration file, add a new
Claimelement in theGloballyAcceptedClaimssection and set itsUriattribute to the Claim URI of your new Claim.