Replies: 1 comment 2 replies
-
For the We could also loosen up “URL” validation, to allow for arbitrary URL schemes. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Following the instructions on the Craft 5 Link field docs, I added a custom Link Type with EVENT_REGISTER_LINK_TYPES and it's working, but I kindof want to explain what I needed and nerdsnipe Pixel & Tonic into adding it.
Why: we're migrating a lot of fields on a lot of sites from Typed Link Field to Craft's Link field and both Typed Link Field and Hyper have a
Custom
type that does not validate that the URL begins withhttp(s)://
nor does it add a pattern or prefix (e.g.tel:
) — and we need this forsms:
links. To match those plugins (and ease our migration from one of them):Please consider adding a linktype
Custom
that has nourlPrefix
, nopattern
, andinputAttributes
of typetext
and inputmodeurl
For additional reference, see this conversation about migration from Typed Link Field to Craft Link field which includes community migration scripts that (necessarily) omit
Custom
links:sebastian-lenz/craft-linkfield#286
What I've done in my custom module:
modules/customlinktype/CustomLinkType.php
modules/customlinktype/linktypes/Custom.php
Beta Was this translation helpful? Give feedback.
All reactions