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

[5.x]: Craft Native Link Field - the native link field don't have the custom title input field #15531

Closed
yumpdevs opened this issue Aug 14, 2024 · 2 comments
Labels

Comments

@yumpdevs
Copy link

What happened?

Description

The craft native link field don't have the link custom title field as showed in Documentation: https://craftcms.com/docs/5.x/reference/field-types/link.html

The current native link field only has the "Action" part for all types of link.
Screenshot 2024-08-14 at 14 18 33

Is this what it supposed to be and we need to create a matrix block to enable the Custom Link Title?

Hyper and Typed Link Field have the feature which allowe user to select whether they would like to open the link in a new window by using a "open the link in new window" checkbox. Can we have that in the native link field as well?

Steps to reproduce

  1. create a "link" field and use it in any entry.

Expected behavior

A Link field with two input box will be created, one is "Title", allow user to enter the custom link text, one is "Action", allow user to select link type and enter the link.

If a checkbox "open in new window" can also be added in the field that would be great.

Actual behavior

Only the input "Action" is created, allowing user to select link type and enter link.

Craft CMS version

5.3.4

PHP version

8.2.20

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@yumpdevs yumpdevs added the bug label Aug 14, 2024
@Megafry
Copy link

Megafry commented Aug 14, 2024

Hi yumpdevs
You need to create a new entry type to replicate this.
My suggestion:
Create the following fields:

  • href as link-field
  • target as dropdown-Field

Create a new entry type with the name Link
Create a new Field linkElement as Matrix

image

Now you have full flexibility, you can also add new field for:

  • Anchor
  • URL suffix
  • Classe
  • Link title
  • Rel (noreferrer)
  • Button style
  • ...

@brandonkelly
Copy link
Member

Right, Link is focused only on storing the actual URL/relation/etc., as noted in the PR (#15251).

Link fields do not have the ability to show settings to control target, label, etc. Those can be captured via separate custom fields.

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

No branches or pull requests

3 participants