include
Inserts a snippet of code from another file.
Note that you don’t have to include the file’s extension .plate
. The theme file’s path is includes/form_field.plate
. You can also pass named variables to the included file by adding key: value
arguments, each separated by a comma. In the example a variable field_type
is available in the included theme file.
You can also pass a Plate object instead of a string for a location.
Assuming that the variable field
is an object with the content type ‘field_line(s)’, this is the equivalent of:
content_for_head
Plate uses a set of CSS and JS to make the nested layout structure and inline editing working. These assets are loaded by putting {% include "content_for_head" %}
in the <head>
of your page.
recaptcha_scripts
If you are using reCaptcha for your forms, you need to add {% include "recaptcha_scripts" %}
somewhere on the page that has the form on it. The form will not be submitted if the scripts are not included on the page! You will receive the following JS error: executeRecaptcha is not defined
if it's not included.