-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Need Unique Class or ID for each Component Panel in Post Edit Panel #6057
Comments
Perhaps this issue could be addressed at the same time as: |
We want to encourage the ecosystem to move away from using CSS selectors to achieve these kind of effects in favor of filters and slots, as they are a lot more robust and portable across platforms (like Mobile), which is going to be one of the targets of the editor in the coming months. Using ids as a way to disable features is going to quickly start falling apart for the developer, and would couple us with the DOM structure. If you need help following the extensibility APIs described in https://wordpress.org/gutenberg/handbook/extensibility/ you may open issues as needed. |
I fully agree that filters and slots are the way to go. For the time being, I have a workaround for Gutenburg. In this specific case, the idea was to use the hierarchal custom taxonomy without the parent dropdown to display a list of checkboxes, The correct way to accomplish that would be a setting in the taxonomy parameters. Because it would be neither hierarchal nor tags no parent dropdown would be needed. I realize this is a special circumstance, but I have seen at least three questions online asking how to accomplish it. I will suggest this over on wordpress.org/ideas and see if there is any interest. |
That's great, and thanks for starting the conversation. I think it'd also be fine as a core ticket if you want to open one. Controlling things from configuration makes a lot more sense to me as something that'd scale better. |
Issue Overview
I see a need to differentiate the component panels in the post edit screens.
In the classic editor, boxes for Categories and Tags are given unique IDs (category div and tagsdiv-post_tag), and custom taxonomies are given IDs such taxonomynamediv.
Adding IDs would allow easier access inside the component. In my specific case, I use CSS to disable the parent category sections when adding new terms to a custom taxonomy.
I think think this would ease the transition of some plugins from to Gutenberg where one might want to
I am using the Gutenberg plugin version 2.6.0 on WordPress 4.9.5 with Genesis Sample theme.
Steps to Reproduce
Current Behavior
Both components are classed as components-panel__body with no ID
Expected Behavior
Unique IDs for each component-panel__body div to differentiate between them.
The text was updated successfully, but these errors were encountered: