Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using just a hash returns 'Link is not a valid URL.' #188

Open
mattbloomfield opened this issue Aug 26, 2024 · 1 comment
Open

Using just a hash returns 'Link is not a valid URL.' #188

mattbloomfield opened this issue Aug 26, 2024 · 1 comment

Comments

@mattbloomfield
Copy link

Describe the bug

Sometimes we just want to add a jump link on the page. I would expect to be able to add #jump-to-here as the input text on link field

Steps to reproduce

  1. Create a hyper field
  2. Add the following as a URL: `#my-custom-id
  3. Try to save the page

Craft CMS version

4.10.2

Plugin version

1.1.32

Multi-site?

No

Additional context

No response

@engram-design
Copy link
Member

It's correct behaviour that # is not a valid URL. We define a valid URL by it being an absolute URL. It's the reason why things like mailto: links won't work as a URL, because they're technically not.

For this reason, you'd pick a "Custom" link type that has no validation, and is essentially a general purpose link for you to have whatever you like in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@engram-design @mattbloomfield and others