Custom Link Type with mailto:

I’m struggling with the link field right now. My client wanted to add a subject to an email link. That obviously doesn’t work, I guess it’s validating the email somehow.

Now I thought there’s the “Custom” link type, where you can freely enter whatever you want. Unfortunately that doesn’t seem to be the case. It always throws a not so helpful error message when saving: “There’s an error on the “Link” field in row 1”.

Am I doing something wrong?

Digging into the field’s source code it looks like this is a bug.

While the docs say the “custom” link type “(…) cannot validate the entered URL”, it does validate it because the detect function of the “email” type looks for strings starting with mailto:. This gets then validated with V::email(). It doesn’t matter which link type I choose, it will always be detected as an email.

To be honest, I think it was a mistake to omit the link type from the saved value :man_shrugging:

+1 with this issue. I would also like to define a subject line in a mailto: link, but Kirby won’t accept the URL as valid (neither as an in-line link within a writer field nor in a dedicated custom link field as above).

I’d also like the ability to add a Subject to a custom link without the email link feature taking over, if possible.

The image below shows what started as a Custom link, but was then converted to an Email link upon save.

Are there any updates / solutions for this? Should we open a GitHub issue?