Page variables are set on a particular web page to enable specific page attributes or functionality. A page variable applies only to the page on which it is set.
This section includes these topics:
Page variables that affect page display are typically set near the top of the page. Page display variables should be used as read-only variables; setting or changing the value of any of these variables will typically change the way all metadata is displayed on the page, which in most cases is not the desired effect.
The following is a list of Idoc Script page display variables:
Field display variables can be grouped into the following types:
The following variables define information about a metadata field. The variable values are loaded or computed for each metadata field.
std_prepare_metafield_include include in the resource file named IdcHomeDir/resources/core/std_page.htm loads a number of field information variables from the local data in preparation for displaying the current metadata field:
<@dynamichtml std_prepare_metafield_include@> <!--Prepare for presenting field--> <$fieldName=dName, fieldCaption=dCaption, fieldDefault=dDefaultValue$> <$fieldType=dType, fieldIsOptionList=dIsOptionList, fieldOptionListType=dOptionListType$> <@end@>
There are several commonly used page variables that affect the display of metadata fields. These variables can be set using different syntaxes at different places on a page, depending on how they are being used.
The following formats can be used to set a special field display variable:
Name/Value pair: The variable is set using the standard
variable=value format. For example,
isHidden=1. This format is typically used to set the display of the current metadata field at the point in the page where the field is being generated by looped code.
FieldName:Variable format: The variable is set by defining it as a parameter for the metadata field it applies to. For example,
myMetadata:isHidden. This format is typically used at the top of a page to set the global display of a particular metadata field.
The following is a list of the common field display variables:
If these common field display variables are not sufficient to provide the required flexibility, the entire implementation of a metadata field can be replaced by setting the field variable to the name of a resource include that should be used instead (for example,
Use this approach only as a last resort. It is preferable to extend existing functionality and set local variables to have custom functionality.
A number of other variables are available to affect the display of metadata fields. Generally, these are used to define the display of a metadata field depending on which field is currently being generated and the value of related common field display variables.
The following is a list of other field display variables:
This example shows how the
compute_std_field_overrides include in the IdcHomeDir/resources/core/templates/std_page.htm resource file determines if the field currently being generated is hidden, information only, excluded, and/or relocated. This code is looped over during generation of each metadata field on a page:
<@dynamichtml compute_std_field_overrides@> <$isCustomHidden = getValue("#active", fieldName & ":isHidden")$> <$if isHidden or isCustomHidden$> <$isFieldHidden = 1$> <$else$> <$isFieldHidden = ""$> <$endif$> <$isCustomInfo = getValue("#active", fieldName & ":isInfoOnly")$> <$if isInfo or isCustomInfo or isFieldHidden or isInfoOnly$> <$isFieldInfoOnly = 1$> <$else$> <$isFieldInfoOnly = ""$> <$endif$> <$isCustomExcluded = getValue("#active", fieldName & ":isExcluded")$> <$isCustomRelocated = getValue("#active", fieldName & ":isRelocated")$> <$if isCustomExcluded or (isCustomRelocated and not isRelocated) or isExcluded or (isFieldHidden and not isFormSubmit)$> <$isFieldExcluded = 1$> <$endif$> <@end@>