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

Allow link suggestions to be configurable #4598

Closed
notnownikki opened this issue Jan 19, 2018 · 7 comments
Closed

Allow link suggestions to be configurable #4598

notnownikki opened this issue Jan 19, 2018 · 7 comments
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Extensibility The ability to extend blocks or the editing experience [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Enhancement A suggestion for improvement.

Comments

@notnownikki
Copy link
Member

Issue Overview

The url-input component uses wp.api.collections.Posts to suggest posts you might want to link to, as you type a link.

This doesn't work for all WordPress installs (on some configurations, the Posts collection isn't usable), and some networks want to suggest posts from all of their sites.

This issue is to discuss possible solutions.

@danielbachhuber danielbachhuber added [Type] Enhancement A suggestion for improvement. Needs Decision Needs a decision to be actionable or relevant [Feature] Blocks Overall functionality of blocks labels Jan 23, 2018
@danielbachhuber
Copy link
Member

While working on #4649, I thought of an alternate implementation:

  • Gutenberg introduces a gutenberg/v1/link-suggestions endpoint.
  • A Link Suggestion Resource (aka truly RESTful) implements title and URL attributes.
  • By default, the endpoint is fed from Posts. However, a third-party could override that with whatever data they want.

@danielbachhuber
Copy link
Member

@iseulde @nylen I think ^ would be a reasonable solution for https://core.trac.wordpress.org/ticket/39965 too.

@danielbachhuber
Copy link
Member

also @kadamwhite ^

@kadamwhite
Copy link
Contributor

This makes sense to me. Making the endpoint's query filterable could turn up whatever is relevant to that site. I would also recommend the result contain an ID or GUID attribute in addition to the URL and title.

However, I'm a little more skeptical that this will be a sufficient solution for #39965; worth discussing, for sure, but our experience is that developers are always frustrated having to make two requests, and providing a slimmed-down search endpoint will still mean that we need to individually query for the full resources (discussions from the 4.8 cycle suggest returning multiple resources with different structures in one request could be an issue for API clients written in certain languages).

@danielbachhuber
Copy link
Member

worth discussing, for sure, but our experience is that developers are always frustrated having to make two requests, and providing a slimmed-down search endpoint will still mean that we need to individually query for the full resources

How much data do you think would need to be included in the response in order to be sufficient?

@kadamwhite
Copy link
Contributor

@danielbachhuber I think that question's out of the scope of this GitHub issue; let's continue it in trac perhaps? But briefly, I don't know that I can say. Custom post types may not even use or have post content or a title, and meta may be needed for some rather than others, so it's unpredictable. There doesn't seem to be an easy one-size-fits-all solution.

@karmatosed karmatosed removed the Needs Decision Needs a decision to be actionable or relevant label Jan 30, 2018
@danielbachhuber danielbachhuber added the [Feature] Extensibility The ability to extend blocks or the editing experience label Jan 31, 2018
@gziolo gziolo added the [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later label Feb 1, 2018
@danielbachhuber
Copy link
Member

This will be addressed with #2084

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Extensibility The ability to extend blocks or the editing experience [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

5 participants