From d973593293b56697bc43a22fc5e5a06b2bc9b3cb Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 30 Jan 2024 18:10:27 +1300 Subject: [PATCH] DOC Add UrlField --- en/04_Changelogs/5.2.0.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/en/04_Changelogs/5.2.0.md b/en/04_Changelogs/5.2.0.md index 46ba83e42..2389eca53 100644 --- a/en/04_Changelogs/5.2.0.md +++ b/en/04_Changelogs/5.2.0.md @@ -14,6 +14,7 @@ title: 5.2.0 (unreleased) - [Create random passwords for new users](#create-random-passwords-for-new-users) - [Buttons to select all files and deselect all files](#bulk-action-buttons) - [New searchable dropdown fields](#searchable-dropdown-field) + - [New `UrlField`](#urlfield) - [Create file variants with different extensions](#file-variants) - [More nuanced permissions for `/dev/*` routes](#dev-route-permissions) - [Generic typehints](#generics) @@ -182,6 +183,10 @@ Both of these fields include a `setIsLazyLoaded()` method which will load a limi Note that these are both powered by react components, and are only intended to be used within the CMS. If you want to use them on the front-end of your project you will need to provide your own templates and JavaScript implementation for them. +### New `UrlField` {#urlfield} + +A new [`UrlField`](api:SilverStripe\Forms\UrlField) has been added which is a subclass of [`TextField`](api:SilverStripe\Forms\TextField) with some additional validation rules. It will validate that the value entered is a valid absolute URL with a protocol and a host. + #### Auto scaffolding of `has_one` relations A `SearchableDropdownField` will now be used when automatically scaffolding `has_one` relations on a form in the CMS. Previously a `DropdownField` was used, and when there were over 100 items a [`NumericField`](api:SilverStripe\Forms\NumericField) was used which was not user friendly.