Disclaimer

Adjoin a disclaimer / terms of use text to an Accept/Reject toggle.

#Motivation

Statamic's logic regarding input is:

Action

If done for a collection

If done for a form

Add a field of a given fieldtype

In the control panel.

In the control panel.

Input a value in the field

In the control panel.

In the front end, input by a user.

Read the field value

In the front end, read by a user.

In the control panel.

In a form, it is common to ask the user to read a disclaimer, terms of service and the like. This can be quite a long text. Yet, the only 2 ways you have to do it natively in Statamic are:

The disclaimer fieldtype provides you with a Bard field that you can configure directly in the blueprint. That way, you can type any length of text and still render all your forms with 1 template.

The disclaimer offers you the possibility to show the text inline with the form controls (if the text is not too long) or as a separate popup (suitable for longer texts), and renders as a toggle that you have to accept or decline.

If you opt for an inline disclaimer text, then it will always be rendered on the full width of the form, thus the following blueprint:

Disclaimer
50%
50%
50%

does not place the 2nd disclaimer on the same line as the first.

As the text needs the full width of the form to render, and was set to appear on top, it pushes the toggle down.
On the other hand, as the 3rd disclaimer is set to show the toggle on top of the text, it can share the same line as the 2nd disclaimer.

#Parameters

Parameter

Name

Description

text

Disclaimer text

Text that is shown to users, effectively the terms of use / disclaimer that must be accepted.

popup

Show the disclaimer in a popup

If true, the Accept/Reject toggle is shown along a button that, upon clicked, shows the disclaimer text in a modal popup.

If false, the disclaimer is shown in a div just above or just under the Accept/Reject toggle.

html_code

HTML code to embed the disclaimer in

If popup is true, the disclaimer field renders text into custom code. The default value for this field should be enough for most uses.

position

Toggle position

If popup is false, determines whether the toggle should be shown immediately above or immediately below the div that contains the disclaimer text.

Disclaimer

Terms of use
You must accept the ToU to use our service:
Show

Short disclaimer

Are you having a good day?

Short disclaimer
Short disclaimers may be shown directly into the form
Toggle before disclaimer
The text associated with this disclaimer toggle is set to appear below.

Toggle before disclaimer

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras et sodales mi. Aenean et lacus porttitor, sollicitudin tellus quis, feugiat eros. Nulla sed ultricies sem. Pellentesque bibendum nulla porttitor eros semper hendrerit. Donec pulvinar consectetur massa, in fringilla justo ultrices at. Donec mattis congue eros vel posuere. Nulla quis pellentesque nisi, non lobortis tortor. Sed mi leo, tristique sit amet nisi eget, rhoncus bibendum est.

Sed a turpis dignissim, tristique purus sit amet, molestie justo. Integer lobortis erat urna, at facilisis ex aliquam sed. Aliquam quam augue, aliquet fermentum pretium id, molestie sed felis. In aliquam eleifend cursus. Nunc fermentum velit a felis congue feugiat.