Tags system
How to retrieve any data or user input inside your WordPress forms with the use of the tags system and how to correctly use them in your WordPress forms.
The tags system in Super Forms is a very simple but yet very powerfull feature that gives any form the flexibility you require.
A so called
{tag}
can retrieve the form data entered by a user on the fly for either later use in your emails, or to directly display it somewhere in your form to be displayed to the user itself.A simple usecase would be to summarize the information entered by the user.
A tag is written with the so called curly braces
{}
with in between the curly braces the unique field name of the element you wish to retrieve the value from.When you have a field name called
first_name
and you want to retrieve this value in your email body you can retrieve it by placing {first_name}
in the body.Dear {first_name} {last_name},
...
Dear John Doe,
...
With checkboxes, radio buttons and dropdowns this will work exactly the same way except that you will also have the ability to retrieve the label instead of the value.
Let's say you added a checkbox element with the following options:
- My fav color is red | Red
- My fav color is green | Green
- My fav color is orange | Orange
The left side is your option
label
and on the right your value
.If you would call your checkbox
fav_color
then you would retrieve the selected option values with the tag {fav_color}
. But if you want to retrieve the label you can use {fav_color;label}
.Selected color(s): {fav_color}
Selected color(s): {fav_color;label}
...
Selected color(s): Orange
Selected color(s): My fav color is orange
...
Another feature you have with checkboxes, radio buttons and dropdowns is to save multiple values per value. In order to do this the only thing you will have to do is separate each value per option with a semicolon
;
.For instance, when you sell multiple packages based on a specific membership, you might need a different price per membership. Let's say we have a Standard membership and a Gold membership. We will ask the user to select a package. We will use a dropdown field so the user can select the according membership.
The dropdown will be named
membership
and will have 2 items with Label / Value:Standard
/standard;10
Gold
/gold;25
Now whenever the user has selected an item from the dropdown, we can retrieve the correct price depending on their membership.
- To retrieve the Standard membership price we would use the tag
{membership;2}
which would return10
- To retrieve the Gold membership price we would also use the tag
{membership;2}
which would return25
Now you might ask where should I actually place this tag? You can choose to use it in one of the following locations/functions:
- Inside a HTML element (to display it to the user in for instance a summary)
- Inside Conditional logic
- Inside Variable fields
- Inside any of the Form Settings, think of setting a custom Contact Entry Title, or defining a custom Subject for your emails or perhaps inside the email body itself
Because this feature is especially useful in combination with the Calculator element, you can read about using regular expressions within tags here: Calculation examples
- Inside your E-mail bodies, Subjects, and all other email headers you could think of.
- In combination with E-mail if statements
- Within your HTML elements
- Inside the Success Message that is displayed to the user after a successfull submitted form
- In combination with Variable fields and also within the conditional logic statements
- When redirecting form to a custom URL to add dynamic parameters e.g: domain.com/?first-name={first_name}&last-name={last_name}
- In validation option for text fields to conditionally check for same value as other field (to compare two field values)
- You can use tags when saving contact entries with a custom title
{your_textarea_field_name_here;word}
(will count all words entered in the textarea){your_textarea_field_name_here;chars}
(will count all characters entered in the textarea, excluding carriage return, line-feed/newline, tab, form-feed, vertical whitespace){your_textarea_field_name_here;allchars}
(will count all all characters entered in the textarea, including carriage return, line-feed/newline, tab, form-feed, vertical whitespace)
{fieldname}
(retrieve list with file name(s)){fieldname;count}
(retrieve total amount of files connected to this file upload element){fieldname;new_count}
(retrieve total amount of files that are yet to be uploaded){fieldname;existing_count}
(retrieve total amount of files already/previously uploaded){fieldname;url}
(retrieve file "blob" or "URL"){fieldname;size}
(retrieve file size){fieldname;type}
(retrieve file type){fieldname;name}
(retrieve file name){fieldname;ext}
(retrieve file extension){fieldname;attachment_id}
(retrieve file ID after file has been uploaded when form is submitted){fieldname;url[2]}
(retrieve specific file data, this example retrieves the third file URL if it exists based on array index){fieldname;allFileNames}
(retrieve list with all file names, it's possible to filter this list with filter hook:super_filter_all_file_names_filter
{fieldname;allFileUrls}
(retrieve list with all file URLs, it's possible to filter this list with filter hook:super_filter_all_file_urls_filter
{fieldname;allFileLinks}
(retrieve list with a link to the file, it's possible to filter this list with filter hook:super_filter_all_file_links_filter
{post_title}
{post_id}
{post_meta_****}
{real_ip}
{wc_cart_total}
,{wc_cart_total_float}
,{wc_cart_items}
,{wc_cart_items_price}
{submission_count}
{last_entry_id}
{last_entry_status}
{user_last_entry_id}
{user_last_entry_status}
{server_http_referrer_session}
(saves HTTP_REFERRER (previous page URL) into session)
{server_http_referrer}
(saves HTTP_REFERRER (previous page URL) into session)
{server_timestamp_gmt}
,{server_day_gmt}
,{server_month_gmt}
,{server_year_gmt}
,{server_hour_gmt}
,{server_minute_gmt}
,{server_seconds_gmt}
{server_timestamp}
,{server_day}
,{server_month}
,{server_year}
,{server_hour}
,{server_minute}
,{server_seconds}
{post_permalink}
(will retrieve the current post permalink where the form is placed on)
{contact_entry_id}
(can only be used in Success Message and E-mails)
{post_author_id}
and{post_author_email}
(can be used in both the Hidden field and Text field Default value option)
{user_login}
,{user_email}
,{user_firstname}
,{user_lastname}
,{user_display}
,{user_id}
,{user_roles}
(can be used in both the Hidden field and Text field Default value option){user_meta_****}
tag to retrieve user custom meta data
{option_****}
{option_****;arrayKey}
{option_admin_email}
{option_blogname}
{option_blogdescription}
{option_blog_charset}
{option_date_format}
{option_default_category}
{option_home}
{option_siteurl}
{option_template}
{option_start_of_week}
{option_upload_path}
{option_posts_per_page}
{option_posts_per_rss}
{field_XXXXX}
{loop_label}
{loop_value}
{loop_fields}
{datepickerfieldname;timestamp}
{datepickerfieldname;month}
{datepickerfieldname;year}
{datepickerfieldname;day}
{datepickerfieldname;day_name}
{datepickerfieldname;day_name_short}
{datepickerfieldname;day_name_shortest}
{datepickerfieldname;day_of_week}
{pdf_page}
{pdf_total_pages}
{_generated_pdf_file_label}
{_generated_pdf_file_name}
{_generated_pdf_file_url}
Last modified 4mo ago