- Getting Started
- Field Types
- Email Notifications
-
Integrations
- MailerLite
- Create User Accounts with Convert Forms
- MailChimp
- HubSpot
- GetResponse
- AcyMailing
- Content App
- Webhooks Addon
- Facebook Meta Pixel
- Google Adwords
- Sync submissions with your favorite app
- Drip Ecommerce CRM
- Google Analytics
- Constant Contact
- SalesForce Web-to-Lead
- IContact
- Zoho CRM
- Elastic Email
- Zoho Campaigns
- Zapier
- ConvertKit
- Brevo (Sendinblue)
- Campaign Monitor
- AWeber
- ActiveCampaign
-
Functionality
- Scroll the Page to the Top When a Long Form is Submitted
- Display Submissions Count for a Specific Form
- Populate Drop Down, Radio Buttons or Checkboxes with a CSV File
- Automatically Delete Submissions Older Than X Days
- Silently POST Submitted Data to Any API or URL
- Automatically Save Each Submission to a JSON file
- Authenticate and Login a User with a Custom Joomla Form
- Auto-Populate a Form Field with an Article Data
- Add a placeholder text to a Dropdown
- Create Multilingual Forms in Joomla
- Create a custom Joomla User Registration Form
- Redirect User to a URL After Form Submission
- Export and Import Forms across different Websites
- Export Form Submissions to CSV
- Convert Forms
- Styling and Customization
- Payment Forms
- Advanced Features
- Developers
- Troubleshooting and Support
-
Spam, Security & Compliance
- Enforcing a Custom Password Policy in Convert Forms
- Add Cloudflare Turnstile to your Joomla Form
- Implement the Iubenda Consent Database in Joomla with Convert Forms
- Add Custom Validations to Fields and Forms
- Add Math Captcha to your Form
- Prevent a Field From Saving in the Database
- Add hCaptcha to your Form
- Enable Double Opt-in
- Allow Form Submissions in Specific Date Range
- Ensure a Unique Value is Entered Into a
- Block Form Submissions Containing Profanity (Bad Words)
- Block Email Addresses or Email Domains
- Native Convert Forms Anti-spam Protection with Honeypot
- Add reCAPTCHA to your Form
- Create GDPR Compliant Forms
Using the Conditional Content Shortcode in Convert Forms
Convert Forms provides an IF shortcode that allows you to perform conditional logic based on user input and global conditions across various sections, including Success Message, Emails using Tasks, HTML Fields, or even in the PDF Form Submission.
The syntax is the following:
{if condition1 = value1 AND condition2 = value2}
content here
{else}
alternative content here
{/if}
To delve deeper into the details of syntax, explore the various comparison operators, build-in conditions, and functions, visit Using the Conditional Content Shortcode in Tassos Extensions. If you are familiar with the syntax, you can proceed below to learn more about incorporating it effectively with Convert Forms.
TABLE OF CONTENTS
- Requirements
- Where Can I Use It?
- Conditional Content Based on User Input
- Conditional Content Based on Submission State
- Conditional Content Based on Global Conditions
Requirements
You will need Convert Forms Pro 4.3.0+ to use the conditional content shortcode.
Where Can I Use It?
The shortcode is versatile and can be employed almost anywhere you can write text within the Convert Forms builder. It seamlessly integrates into key areas, including:
- Success Message
- Email Message using Tasks
Note: The deprecated "Behavior > Email Notifications" do not support Conditional Content Shortcodes. - PDF Form Submission
- HTML Fields
- Form Footer
- Custom CSS
- Custom Code
Conditional Content Based on User Input
The shortcode allows you to perform conditional logic based on the user input after the form submission. To do so, use the following syntax:
{if field.FIELDNAME = value} content here {/if}
Where FIELDNAME is the field name, you would like to compare its value.
Let’s see some practical use cases:
Show content if a field equals a certain value
The most common scenario is where we want to check whether a field equals a certain value. Let’s say the field we want to check is named “name”. To do so, use the Equals operator as in the example below:
{if field.name = John Doe} Your content here {/if}
Show content if a field contains a certain text
Let’s say your form includes an email field where you would like to check whether the user entered a Gmail address. To determine whether a field value contains another text, use the Contains operator, as in the example below:
{if field.email contains gmail.com} Your content here {/if]
Show content if a number field is less than another number
Imagine your form includes a number field named “year” posing the question "Year of Birth". You want to display the text “Not old enough” when the user does not meet age requirements, specifically when the user input is less than 2005. Achieve this by utilizing the following shortcode:
{if field.year < 2005} Not old enough {/if}
Show content if a certain dropdown or radio button option was selected
Imagine your form incorporates a dropdown or radio buttons field named "math" posing the question "What's 5+5?" with the choices: 5, 10, and 15. If the user selects the accurate response, you want to present the message "Your answer is correct". Achieve this by utilizing the following shortcode:
{if field.math = 10} Your answer is correct {/if}
Show content if a field is empty
Let’s say your form includes an optional field named “age” and you want to present a specific message when the field is blank. To determine whether a field is empty, use the Empty operator as follows:
{if field.age empty} Your content here {/if}
This can also be written as:
{if !field.age} Your content here {/if}
Show content if a date field corresponds to the current day
Let’s say there’s a date field in your form named “checkIn” and you would like to display a certain content when the user selects a date corresponding to the current day. To do so, utilize the today() built-in function as in the example below:
{if field.checkIn = today()} Your content here {/if}
Show content based on how many files the user uploaded
Let’s say your form includes a file upload field named “uploads”, and you would like to create conditional logic based on how many files the user has uploaded, and specifically if the user uploads more than 3 files, display a certain text.
To do so, you will need to utilize the count() built-in function as follows:
{if count(field.uploads) > 3} Your content here {/if}
Conditional Content Based on Submission State
The shortcode allows you to perform conditional logic based on information regarding the submission. To do so, use the following syntax:
{if submission.CONDITION = value} Your content here {/if}
Where CONDITION can be any of the following:
Condition | Return Format | Expected Value |
---|---|---|
id | Numeric | A number representing the unique ID of the submission |
created | Datetime | A date representing the date the submission was created. |
modified | Datetime | A date representing the date the submission was last modified. |
form_id | Numeric | A number representing the ID of the form associated with the submission |
user_id | Numeric | The ID of the Joomla User account submitted the form.
If the user is not logged in, it will return 0. |
state | Numeric |
A number representing the submission status, and it can be any of the following:
|
count | Numeric | A number representing the total number of submissions the form has received. |
Show content based on the submission date
In the scenario where you would like to display content based on the submission date, use the submission.date as follows:
{if submission.date > 10-20-2024} Your content here {/if}
Show content based on the submission count
You can also compare based on a form's number of submissions. To do so, use the submission.count condition as follows:
{if submission.count <= 1000} Your content here {/if}
Show content based on the submission state
You can also compare based on the state of the submission. For instance, you may need to display the text “Confirmed” and “Pending” respectively. To do so, use the submission.state condition as follows:
{if submission.state = 1}
Confirmed
{else}
Pending
{/if}
Conditional Content Based on Global Conditions
With the Convert Forms Conditional Content Shortcode, you can restrict or grant access to content parts based on various conditions such as Device, User Group, Date, URL, Language, and more.
To learn more details about the available conditions, visit the Conditions section.
- Requirements
- Where Can I Use It?
- Conditional Content Based on User Input
- Show content if a field equals a certain value
- Show content if a field contains a certain text
- Show content if a number field is less than another number
- Show content if a certain dropdown or radio button option was selected
- Show content if a field is empty
- Show content if a date field corresponds to the current day
- Show content based on how many files the user uploaded
- Conditional Content Based on Submission State
- Conditional Content Based on Global Conditions