Skip to content

Add collapsible behavior to term edit page#1174

Open
gabrielcld2 wants to merge 2 commits into
developfrom
feature/taxonomy-fields-dropdown
Open

Add collapsible behavior to term edit page#1174
gabrielcld2 wants to merge 2 commits into
developfrom
feature/taxonomy-fields-dropdown

Conversation

@gabrielcld2
Copy link
Copy Markdown
Collaborator

Approach

  • Refactored taxonomies.js to support multiple collapsible instances per page using querySelectorAll, resolving content targets via a data-collapsible-target attribute and getElementById. Visibility is now toggled via
    the hidden attribute (replacing style.display) to correctly handle both <div> and <tbody> elements. Arrow icon state uses classList.toggle with a force argument.
  • Added aria-expanded, aria-controls, and aria-label to all collapsible toggle buttons for screen reader accessibility.
  • Extracted the card box-model styles from .cloudinary-collapsible into a --card BEM modifier in _settings.scss, keeping layout-specific styles separate from the shared toggle/content rules. Extended the __toggle
    heading selector to cover both h2 and h3.
  • Updated taxonomy-transformation-fields.php to use the --card modifier, wire up data-collapsible-target / id on the toggle and content elements, and replace style="display:none" with the hidden attribute.
  • Added collapsible behavior to taxonomy-term-transformation-fields.php using paired <tbody> elements per transformation context — a toggle row containing the heading and button, and a content <tbody> (initially
    hidden) wrapping the existing field rows — preserving valid table structure throughout.
  • Added custom CSS class cloudinary-term-transformations to the tbody elements added by Cloudinary so that it can be targeted for custom styling if needed.

QA notes

  • Go to the taxonomy term edit form
    • Confirm the custom cloudinary fields are now shown behind a dropdown
    • You should be able to toggle the dropdown to see its content
  • Confirm the the taxonomy term creation form still shows the dropdown as before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants