By Fluffy Convict on
From an end-user perspective, I would like Drupal to remember which page sections I have (not) collapsed, so that the page layout remains the same after I, for example save the settings.
Currently, after having saved a settings page or after having browsed from and to a settings page, all page sections are intracted again. I would like to have them the way the are. Is it possible to store this information in a cookie / session?
Comments
possible?
possible - but probably not easy.
I think this would be a substantial feature request. Right now the default collapsed/not is hard-coded in every module's form definition.
Since the appearance is controlled by javascript, perhaps a client-side solution would be possible (e.g. a cookie) and easier than trying to get the information back into the database. I am a novice with JS, so I really can't say how hard this would be.
---
Work: BioRAFT
The cookies approach would
The cookies approach would almost certainly be easiest - javascript could be used to set the state correctly after the form loaded.
However this approach is not very clean, since it could involve spamming the user with lots of site cookies, and could run into display issues using js to set the state.
A cleaner (but more complex) approach would be to use hook_form_alter to alter the state of each fieldset before it is even sent to the client. The users state information for each fieldset could then be saved in the database, after being collected using javascript (that populates a hidden form field with the state of each fieldset, or maybe fires an AJAX handler.