Overview
Theunique_id macro generates a pseudo-unique identifier by combining five random integers separated by underscores. This is useful for creating unique HTML IDs, cache keys, or other identifiers that need to be distinct.
Syntax
Parameters
This macro takes no parameters.Return Value
Returns a string containing five 6-digit random integers joined by underscores. Example output:123456_789012_345678_901234_567890
Usage
Import the Macro
This macro depends on the
random_int macro, so ensure both are available in your template.Basic Example
483921_726450_158392_604827_391845 (values will vary)
Common Use Cases
Ensuring Uniqueness in Loops
Implementation Details
The macro:- Calls
random_int()five times to generate five random 6-digit numbers - Joins them with underscores using the
joinfilter
Related Macros
- random_int - Generates a single random integer (used internally by this macro)