1

When editing a node the meta panel fieldset accordions default to being open if they contain data.

I understand why this has been done, but I think it makes for a very noisy and potentially confusing UI for my editors.

How could I go about making these closed by default?

meta panel with accordions open

meta panel with accordions open

  • Just wanting to confirm that this also happens with Drupal 8 – MrPaulDriver Aug 13 at 12:37
  • Doesn't occur on D8, or atleast not with the default D8 admin theme. – No Sssweat Aug 13 at 12:49
  • On a fresh latest D9 9.03 using Claro experimental admin theme I don't see this issue either. They are all closed as expected. Any JS errors in your browser's console? – No Sssweat Aug 13 at 13:05
  • Sorry I was not being clear. I meant once populated and upon re-editing they are open. Seven and Claro. 8 & 9 – MrPaulDriver Aug 13 at 13:50
2

There are different approaches to change this behaviour. For instance, you could choose between these two at least:

  • CSS + JS: using a selector like .layout-region-node-secondary (depending on Theme), you could loop using a jQuery $.each() over the different 'details' and, if you find the 'open' property, remove it.

  • PHP: Using Hook Event Dispatcher, you could attach to the node alter event and upon firing, you could just alter the form accessing the $form / $form_state variables and removing the CSS from the items you'd like to.

| improve this answer | |
  • Thank you for the tip @jbarrio. I don't do much coding I was hoping there might be a module for this. – MrPaulDriver Aug 13 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.