• Resolved Brandon Zhang

    (@heybran)


    Hello WordPress devs,

    Greetings from China. We had a request from our client to modify the default behavior of the Gutenberg LinkControl component, to achieve:

    • When search for a word “promotions” or “/promotions”, server needs to query for posts which permalink matches the search term. (This part is already handled in the php side).
    • When the server sends back the results, we want to link previews in the LinkControl component to respect the order of the posts returned from the server, but as it seems with the default LinkControl behavior, it does some kind of suggestions on top of the results sending from the server, which ends up my first result from server is not the first item rendered in the search modal, please refer to the screenshot I made, hope it will make more sense.

    I have been reading the source codes on the LinkControl block, but that doesn’t give me any ideas moving forward: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-editor/src/components/link-control/search-results.js

    I would very much appreciate if anyone can point me to the right direction on how I should tackle this issue.

    Screenshot link: https://ibb.co/Rb9HGGH

    If above link doesn’t work, please check this one: https://postimg.cc/JyrCKTGq

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey @heybran,
    I have reviewed your query. Please ensure you enter the full URL, like https://example.com/test/, and then submit it.

    I hope this can be helpful.
    Thanks

    Thread Starter Brandon Zhang

    (@heybran)

    Hello @ravindra107

    Thanks for reviewing, but I’m developing locally though, and it’s also behind a login, so I’m afraid not URL can be provided at the moment.

    Thread Starter Brandon Zhang

    (@heybran)

    I’m closing this topic as we will not implement this for now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.