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

FormTokenField cannot have identical names in value. #24

Open
4 tasks
anwas opened this issue Mar 16, 2023 · 1 comment
Open
4 tasks

FormTokenField cannot have identical names in value. #24

anwas opened this issue Mar 16, 2023 · 1 comment
Labels
Ryan Has Issues Your issues are my issues! Streamed This topic was streamed

Comments

@anwas
Copy link

anwas commented Mar 16, 2023

Describe the issue your running into with your code

Description of the "Post Picker" block concept

The purpose of the "Post Picker" block is to replicate the "Relationship" Field Type of the ACF Pro plug-in.

Currently I have developed the ability to select records of a given post type by title using the "FormTokenField" component.

The elements in the suggestion list of the "FormTokenField" component must be unique. Unfortunately, sometimes a website may contain entries with identical titles and then the suggestion and value list of the "FormTokenField" component will not work. I have created a workaround for this limitation: https://github.com/whatever-for-ever/wordpress-development/blob/341889b1a5e7218907f3ce58419bbf76b109b42a/wp-content/plugins/an-whatever/_src/blocks/post-picker/edit.js#LL87C6-L118C8

Given this limitation, it is necessary to see if the "FormTokenField" component is a suitable choice for the "Post Picker" block.

In order to make the "Post Picker" block fully functional, help is needed for the following tasks:

  • create a taxonomy selection filter
  • create a record type selection filter
  • create the ability to reorder the selected records (this is a very high priority task)
  • according to the previous tasks, we need to see if it is possible to achieve this functionality using the 'FormTokenField' component. If it is not possible, an alternative must be found

Examples

ACF Pro "Relationship" Field Type

image

Current implementation achieved

image

Desired result

If the above tasks could be achieved, the ACF Pro plugin would no longer be needed in many places. I hope that with your help we can achieve the desired result.

Notice. I have edited this Issue because I have cleaned up the problem. Do apologize for the text errors as my English is not as good as I wish

Link to where I can see the code ( gist, repo, etc )

https://github.com/whatever-for-ever/wordpress-development/tree/341889b1a5e7218907f3ce58419bbf76b109b42a/wp-content/plugins/an-whatever/_src/blocks/post-picker

@anwas anwas added the Ryan Has Issues Your issues are my issues! label Mar 16, 2023
@ryanwelcher
Copy link
Owner

Done!

@ryanwelcher ryanwelcher added the Streamed This topic was streamed label Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ryan Has Issues Your issues are my issues! Streamed This topic was streamed
Projects
None yet
Development

No branches or pull requests

2 participants