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

Need Unique Class or ID for each Component Panel in Post Edit Panel #6057

Closed
MikeB8s opened this issue Apr 7, 2018 · 4 comments
Closed

Need Unique Class or ID for each Component Panel in Post Edit Panel #6057

MikeB8s opened this issue Apr 7, 2018 · 4 comments
Labels
[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

@MikeB8s
Copy link

MikeB8s commented Apr 7, 2018

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

  1. Open a post in Gutenberg
  2. Select Document at top of side-bar.
  3. Inspect the code for Categories and Tags. I am using Chrome DevTools

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.

@danielbachhuber danielbachhuber added [Type] Enhancement A suggestion for improvement. [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later labels Apr 10, 2018
@danielbachhuber danielbachhuber added the [Feature] Extensibility The ability to extend blocks or the editing experience label Jun 4, 2018
@MikeB8s
Copy link
Author

MikeB8s commented Aug 4, 2018

Perhaps this issue could be addressed at the same time as:
Taxonomy meta box title language #8449, since it would also use parameter(s) from the taxonomy settings.

@mtias mtias removed this from the Merge: Plugins milestone Oct 3, 2018
@mtias
Copy link
Member

mtias commented Oct 7, 2018

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.

@mtias mtias closed this as completed Oct 7, 2018
@MikeB8s
Copy link
Author

MikeB8s commented Oct 8, 2018

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.

@mtias
Copy link
Member

mtias commented Oct 8, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[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

3 participants