Hyperlink fieldtype to cater hyperlinks

Hi All!

Our team has bumped into a usecase where we need to cater to hyperlinks. We were looking into using HTML fields or Editor fieldtype but it turns out it cannot do what we need. We though that the feature that will work for us are the following:

  1. The field should work like a link field but with no validations for option and has the clickable button to redirect to the input web link.
  2. It should open a new tab when opening the weblink.
  3. It will transform into a hyperlink when set to readonly.

We tried creating it in the core for possible PR and here is our initial output.

Any thoughts of its potential to be a core feature? We wanted to know if others are also looking for this kind of functionality. Feel free to let us know as well for any suggestions.

Thank you!

Hi,

The Data fieldtype, when used with the URL option already fulfils all of your requirements:

image

3 Likes

Hi @snv !

I have tested it and it works as expected. Thank you so much for this!

Best,

Dory

2 Likes

To add, lets note that this was not documented in the manual here https://docs.erpnext.com/docs/v14/user/manual/en/customize-erpnext/articles/field-types#data which should be added. This is indeed very helpful feature!

It’s a part of the framework docs here:
https://frappeframework.com/docs/v14/user/en/basics/doctypes/fieldtypes#data

But we should document it better, with all features described :+1:

1 Like

Cool! Thanks @snv !