-
Notifications
You must be signed in to change notification settings - Fork 18
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
Collapsed by Default #17
Comments
Thanks for opening this up. I personally say the default behavior should NOT collapse by default (like how it is now), but I think it should be a global option, probably on a per-user setting. I'd propose that there is a settings page under Settings > ACF Repeater Collapser which displays a select or checkbox for "Default to Open" and "Default to Collapsed" and maybe a user or user role repeater that lets you override the selected option above. Maybe it could use wp_dropdown_roles()? I might be willing to help make these changes if you don't have time. I have a client who requested this functionality so I wrote that little plugin but I don't feel super great about how it works (it just fires a jQuery "click" on your collapse all button after your JS loads). |
@JulienMelissas Thanks for this good feedback. I think your vision for a rather simple implementation of this feature makes sense to me. I might consider tucking the option on the Settings > Writing screen if it's only going to be a single checkbox. If it's per-user, then it would probably go on the My Profile page even though that doesn't feel all that great to me. Once we can hammer out the details of the feature and get the ACF5 support stable, I'd be happy to accept a pull request on this feature. You definitely took a quick and dirty approach in your version of the feature. Probably made sense for a one off, but we could definitely do better by catching it during the JS init functions. |
I'd say simple implementation is the best option - you don't want your plugin to be too bloated. Today I was actually hanging out with a few friends of mine and I asked them where they would put the feature. One of them is a plugin developer and the other works for Automattic. One of them asked "can't you just make a button that toggles ALL of the rows?" and I mentioned that you had that. We talked about it a little more and thought that checking for user roles might not be reliable enough and that it's actually not an easy problem to solve, but that it might not need it's own settings page in the backend. I personally like the idea of a checkbox living in the writing settings page, only thing is that it might not be super intuitive. I had been thinking about another option that one of my friends mentioned as well - what about a filter? It could be as simple as a if_function_exists and then inside that a flag for collapse_by_default = true or something like that. The could be placed in the theme's functions.php or even in a per-theme plugin. It's a little less intuitive but might be the best solution, as you could do checks for current_user_can and the like... Just thought I would offer my 2cents. Either way I'm happy to help with implementation down the road once you're more comfortable with how the ACF5 support is coming and have made a decision about how you think it should work. |
|
|
|
+1 for collapsed by default. Ideally it would be either filterable or a setting somewhere. Doing it on a per-user basis sounds kind of like overkill to me, but overrides of a global setting on a per-field basis seems reasonable. |
+1 for collapsed by default. Or a global option at least to either have it either the way it is now (all expanded) — or to have it all collapsed. |
+1 for collapsed by default. My main reason for using this plug is so that the users don't have to scroll too much, but if the fields aren't collapsed by default and it's not really doing the job for me. |
+1 for collapsed by default. |
+1 for collapsed by default. Especially when you have a lot of items in a repeater field. |
+1 for collapsed by default & more contrast between the rows too. |
+1 collapse by default :) |
+1 for this. And could the collapsed/expanded state be saved with the page? That would be good too. |
+1 for this :) |
Bumping this because I could really use this functionality 👍 |
Is there a way to do this? |
Questions to answer:
The text was updated successfully, but these errors were encountered: