From bb01d373bb3de7aa469a16222bbb0bd863c9b81f Mon Sep 17 00:00:00 2001 From: Michael Aerni Date: Sat, 24 Jul 2021 10:58:25 +0200 Subject: [PATCH] Make `show_label` available to all fieldtypes --- README.md | 2 +- resources/views/antlers/fields/input.antlers.html | 12 ++++++++---- .../views/antlers/fields/select.antlers.html | 15 +++++++++++---- .../views/antlers/fields/textarea.antlers.html | 12 ++++++++---- resources/views/blade/fields/input.blade.php | 12 ++++++++---- resources/views/blade/fields/select.blade.php | 15 +++++++++++---- resources/views/blade/fields/textarea.blade.php | 12 ++++++++---- 7 files changed, 55 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index da3ca5e4..331fee6e 100644 --- a/README.md +++ b/README.md @@ -320,7 +320,7 @@ There are multiple configuration options for your form fields: | `default` | `array`, `boolean`, `integer`, `string` | All fieldtypes | Set the field's default value | | `inline` | `boolean` | `checkboxes`, `radio` | Set to `true` to display the fields inline | | `placeholder` | `string` | `input`, `textarea` | Set the field's placeholder value | -| `show_label` | `boolean` | `checkboxes`, `radio` | Set to `false` to hide the field's label and instructions. This can be useful for single checkboxes, eg. `Accept terms and conditions`. | +| `show_label` | `boolean` | All fieldtypes | Set to `false` to hide the field's label and instructions. This can be useful for single checkboxes, eg. `Accept terms and conditions`. | | `width` | `integer` | All fieldtypes | Set the desired width of the field. | ## Events diff --git a/resources/views/antlers/fields/input.antlers.html b/resources/views/antlers/fields/input.antlers.html index 2d1a1324..4751d863 100644 --- a/resources/views/antlers/fields/input.antlers.html +++ b/resources/views/antlers/fields/input.antlers.html @@ -1,8 +1,12 @@ - +{{ if show_label ?? fields[field].show_label }} +
+ +
+{{ /if }} -
+
- {{ label ?? fields[field].label }} - +{{ if show_label ?? fields[field].show_label }} +
+ + {{ if instructions || fields[field].instructions }} +

{{ instructions ?? fields[field].instructions }}

+ {{ /if }} +
+{{ /if }} -
+