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

Link UI does not preserve link relationships for Post (entity) links #32282

Closed
Tracked by #35073
getdave opened this issue May 27, 2021 · 4 comments
Closed
Tracked by #35073

Link UI does not preserve link relationships for Post (entity) links #32282

getdave opened this issue May 27, 2021 · 4 comments
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting)

Comments

@getdave
Copy link
Contributor

getdave commented May 27, 2021

What problem does this address?

When adding a link within a paragraph block you can search and choose from a list of existing Posts (eg: entities - including Pages).

However, once you've added this link the relationship to the original Post entity is not preserved.

Screen.Capture.on.2021-05-27.at.16-35-48.mov

You can try this by:

  1. adding a link to a Post you've created.
  2. click away onto another block.
  3. clicking back on the link you just created.
  4. You will see it's "type" is URL and there is no information preserved about the Post you originally link to.

What is your proposed solution?

In the Navigation block we preserve the relationship to the entity so that once the link is added it contains some metadata which link it back to it's original entity. That way we should be able to display the link as type Page or Post or whatever and in future we should be able to pull through additional metadata to display in the Link UI.

@getdave getdave added the [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) label May 27, 2021
@getdave
Copy link
Contributor Author

getdave commented Jun 15, 2021

Interestingly it looks like the format library does in fact preserve both the link type (ie: post type) and entity id if provided. However we don't really make use of them.

@azaozz
Copy link
Contributor

azaozz commented Jun 17, 2021

Wondering if it's worth it going a step further like having a data-wp-postid attribute on internal links. Another reason is that the url_to_postid() (PHP) function is bad, slow, hacky, etc. :) Having a good, reliable way to avoid it would be pretty nice.

@getdave
Copy link
Contributor Author

getdave commented Mar 15, 2023

Related #18345

@getdave
Copy link
Contributor Author

getdave commented Mar 17, 2023

Closing in favour of #18345

@getdave getdave closed this as completed Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting)
Projects
None yet
Development

No branches or pull requests

2 participants