Id

Id

{% id %}

Creates a "unique" identifier each time it is called. Each identifier consists only of lowercase letters, and each subsequent call simply increments it by 1 character (ie: 'aaa' -> 'aab' -> 'aac', etc...).

Identifiers created using this method are not random and therefore will not prevent caching. However, if the number of times the id method is called or if the arguments to the id method is changed the identifiers may not be consistent between page loads - which means that you should not rely on identifiers created using this method for styling or for creating sharable links.

{% auth change_id %}

Functions as an alternate init command if the old_id argument is supplied.

Sets the id for the profile to the id specified. If ths site is configured to set the id an email to the same value then this will validate the id as a valid email address and will set the email to this value as well.

Note that this does NOT log the profile out, deactivate it, or require any further confirmation or action by the user to continue using their profile. Those actions are up to the template developer to execute (which we strongly recommend whenever the email address is changed).

Sets {{ auth.id_changed }} to true if successful or false if not. If successful sets {{ auth.old_id }} and {{ auth.new_id }} to the old and new id values and sets {{ auth.id }} to the new id. Note that any future auth init commands will have to use the new id instead of the old one.

If successful and the site is configured to set the id and email to the same value then this also sets {{ auth.email_changed }} to true and sets {{ auth.old_email }} and {{ auth.new_email }} to the old and new email values.

If successful, the {% auth abort %} command may not be called.

Error Codes:
command_disabled: Indicates that the current method has been disabled at the site level. This will be set for any auth method if profiles are disabled.
duplicate_command: Indicates that the {% auth change_id %} method has already been called. It may only be called once per page load. If the site is configured to set the id and email to the same value then this error code may also indicate that the {% auth change_email %} method has already been called.
no_init: Indicates that no initialization method has been called yet and no value was provided to the old_id parameter.
bad_init: Indicates that another initialization function was called with a different id.
aborted: Indicates that the method could not be performed because {% auth abort %} has been called.
not_found: Indicates that no profile was found with the old id.
blocked: Indicates that the profile is currently blocked.
locked: Indicates that the profile is currently locked.
inactive: Indicates that the profile is currently inactive and must be activated first.
missing_value: Indicates that no new_id argument was supplied to the {% auth change_id %} method.
unchanged: Indicates that the id was not changed because it was the same as the old id.
duplicate_value: Indicates that another profile already exists with the new id.
unexpected: Indicates that the system encountered an unexpected error which is not due to any of the common issues associated with profiles. This is a rare error code but may be possible in edge cases such as duplicate concurrent requests, infrastructure issues, or suspected security incidents.

Examples

Save Id

Copy
...

Short Id

Copy
...

Long Id

Copy
...

Skip Id

Copy
{% for image in entity.images %}
...
{% endfor %}

Generate Id

Copy
...