You may have many reasons to create an "Agree to Terms of Service" or similar checkbox field in your Shack Form.
Your form submitter will view this field as a checkbox with a clickable URL:
Once they clicked the URL, they will see a modal box with the text of your Terms of Service:
Creating such a field is a three-step process:
- Create a Joomla article with your Terms of Service
- Create a menu item for this article
- Create "Agree to Terms of Service" field by the "Single checkbox" type.
Step #1. Create a Joomla article with your Terms of Service
- In your Joomla administrator panel, go to Content > Articles > Add New Article:
- Create a Joomla article with your Terms of Service. For my demonstration, I created an article with the title "Our Terms of Service":
Good job! You now have a Joomla article with your Terms of Service. To be able to display this article to your Shack Form submitter, Shack Forms need to know the article's URL.
Let's get this URL.
Step #2. Create a menu item for this article
To get the article's URL, you need to create a menu item, pointing to this article. The menu item doesn't have to be displayed if you create it purely for your Shack Form. It can be hidden.
Very often, as a Joomla site growth, it needs a few hidden menu items. A good practice is to create a separate menu for such hidden menu items.
This is exactly what you will do in this step.
- Go to Menus > Manage > Add New Menu:
- Create a new menu. I called mine "Hidden Menu":
- Go to Menus > Hidden Menu > Add New Menu Item:
- Create a new menu item pointing to your "Terms of Service" Joomla article. For my demonstration purposes, I called my hidden menu "Terms of Service":
Note: to make this menu item hidden, make sure to set its "Display in Menu" setting to "No" under the "Link Type" tab:
- Click Save.
- Copy the URL from the "Link" field:
Excellent! You now have the URL of your "Terms of Service" Joomla article. You are now ready to create the "Agree to Terms of Service" checkbox field.
Step #3. Create "Agree to Terms of Service" checkbox
- Open up your Shack Form module.
- Under the "Module" tab click "Add new field":
- Enter "Agree to Terms of Service" into the "Field label" box.
- Go to the "Field type" and select "Single checkbox":
- Go to the "Agree to rules URL or HTML element ID" field and paste in it the URL you copied in the previous step. Add at the end of your URL
&tmpl=component
. You should end up with having in this field URL resemblingindex.php?option=com_content&view=article&id=71&tmpl=component
. - Click Required.
- Click Save.
Excellent! Now when you check your Shack Form, you will notice the clickable "Agree to Terms of Service" checkbox, as you saw in the screenshot at the beginning of this tutorial.
When you click on it, you will see your Joomla article with Terms of Service in a modal box, once again, just as you saw in the screenshot at the top of this tutorial.