Allow 'link text' without 'URL' (URL optional)

Created on 23 May 2017, almost 8 years ago
Updated 31 January 2025, 25 days ago

In drupal 7 you had the ability to make the URL field optional, this seems to have been removed for drupal 8.

It does seem possible at the moment: when you configure the link field with an "Allow link text: *required".
You should be able to just fill the "link text" field without an URL. But when you save this node, it empties the 'link text' field, you have to put in an url to be able to show the text. That's why it looks like a bug to me at the moment, but maybe this was made intentional?

Use case:

  • A simple "subtitle" field that should link to internal or external content on specific pages. This would be easily made if the URL part was optional.

Proposed solutions:

  • make the URL field optional (make it work like Drupal7 link)
  • if this is not possible, perhaps a token ? this would be the worse option.
Feature request
Status

Active

Version

11.0 🔥

Component

link.module

Created by

🇳🇱Netherlands bskibinski Breda, The Netherlands

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany Anybody Porta Westfalica

    Just ran into this and can confirm it would be super helpful for some edge-cases. I know this is called link-field but the flexibility bonus would really help.

    Another real-world example: We have a "License information" link field. In 90% of the cases this uses a URL and a description, but in some cases there just IS no source URL and so the author should be allowed to leave out the URL. It would be great, if the maintainers would accept this request.

    For sure this is not a bug ;) It's a feature request.

Production build 0.71.5 2024