{fieldid:type:num:id_type}

Description

Builds a 16-character field id from a type name and a number, the same id format AA uses internally to address an item field. The type name comes first, then the number is placed at the right end, and the space between is filled with a padding character (a dot by default, or an underscore). Number 0, or no number, gives the base field id of that type. The number must be between 0 and 99999, otherwise the result is an empty string. Use it when a template needs to compose a field id from parts rather than hard-code the 16-character string.

Parameters

type optional default (empty)

The field type name (the prefix), such as headline, abstract, text, or full_text. It forms the start of the field id; the rest is padded to a total length of 16 characters.

num optional default 0

The field number, placed at the right end of the id. 0 (the default) gives the base field id. Must be between 0 and 99999; a value outside that range makes fieldid return an empty string.

id_type optional default the dot character

The padding character used between the type and the number. A dot builds the normal field id (headline........); an underscore builds the alternate underscore form (text___________1).

Examples

test{fieldid:headline:0}
Expectedheadline........
Actualheadline........
With number 0 (or omitted), fieldid returns the base 16-character field id: the type name padded on the right with dots. So headline becomes headline........
test{fieldid:full_text}
Expectedfull_text.......
Actualfull_text.......
Omit the number entirely and it defaults to 0, which produces the base id (all dots after the type). full_text becomes full_text........
test{fieldid:text:1}
Expectedtext...........1
Actualtext...........1
The second argument is the field number. The number lands at the right end, dots fill the gap. Field ids are always 16 characters: text plus 11 dots plus 1.
test[{fieldid:text:100000}]
Expected[]
Actual[]
The number must be between 0 and 99999. A value outside that range (here 100000) is rejected and fieldid returns an empty string rather than a malformed id.
test{fieldid:abstract:12}
Expectedabstract......12
Actualabstract......12
Multi-digit numbers occupy more of the 16 characters, so fewer dots are needed. abstract with number 12 yields abstract......12.
test{fieldid:text:1:_}
Expectedtext___________1
Actualtext___________1
The third argument is the padding character. Pass an underscore to build the alternate underscore-form id text___________1 instead of the dot form.