{% set_profile_setting %}

Saves custom values to predefined profile settings that will be accessible whenever the current profile is logged in. Note that this is meaningless unless the user is logged in.

Profile settings may include validation, in which case all settings will be validated before being set and any validation error will prevent the setting(s) from being set. Validation errors may optionally be output to a variable.

Syntax

{% set_profile_setting
[var|set|assign] errors = new_variable_name
If there are any validation errors encountered while saving the setting value(s), they will be stored in this variable name. If not specified than the validation errors will simply not be saved. The variable will be saved using the "var" behavior unless "set" or "assign" are specified.
setting1:value1
Include one or more settings to set on the profile.
...
%}

You may also include reference variables as properties, which will be dereferenced to their property names before setting the profile settings.

Examples

Set Profile Setting 1

Copy
{% if submission.is_valid and submission.score > 70 %} {% set_profile_setting passed_test:'true' %} {% endif %}

Set Profile Setting 2

Copy
{% var new_layout = request.post_params['layout'] %} {% var new_companyname = request.post_params['companyname'] %} {% var new_description = request.post_params['description'] %} {% set_profile_setting var errors = profile_errors layout:new_layout companyname:new_companyname description:new_description %} {% if profile_errors %} {% for error in profile_errors %}

Error saving {{error.Key}}: {{error.Value}}

{% endfor %} {% endif %}