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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
scroll top