Skip to content
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

Open
mrwweb opened this issue Aug 14, 2014 · 17 comments
Open

Collapsed by Default #17

mrwweb opened this issue Aug 14, 2014 · 17 comments

Comments

@mrwweb
Copy link
Owner

mrwweb commented Aug 14, 2014

Questions to answer:

  • Is this set per-user? (e.g. Can one user have a fieldset open by default and the other collapsed?)
  • Is this set per-field, per-fieldset, or universally?
  • How is this set? An option on a settings page? An option on the fieldset settings? An option on the specific page?
  • Is this the default behavior? (I am almost positive it's not.)
@mrwweb mrwweb changed the title Feature Request: Collapsed by Default Collapsed by Default Aug 14, 2014
@JulienMelissas
Copy link

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).

@mrwweb
Copy link
Owner Author

mrwweb commented Aug 14, 2014

@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.

@JulienMelissas
Copy link

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.

@mrwweb
Copy link
Owner Author

mrwweb commented Aug 15, 2014

  1. Interesting thought on a filter. That may be a smart way to go as I imagine that it's mostly developers who are installing this plugin.
  2. If the setting goes on Writing, there can still be a Settings link on the plugins page too to help people find it.
  3. You've mentioned user roles now a couple times and I'm not quite sure what you have in mind. Is the idea that different roles have different defaults?

@JulienMelissas
Copy link

  1. I think this might be the best option, but I'm not sure... I agree that most people installing are developers.
  2. Totally!
  3. I mentioned user roles because that's how I personally set permissions up on the site when handing off to the client with Adminimize or whatever. My idea was that yes, maybe different roles could have different defaults. Like an admin could have the fields not collapsed by default but an editor might want them collapsed by default... That said, I don't know if that's a very good idea because it could be difficult to implement and someone could just do it with a filter.

@mrwweb
Copy link
Owner Author

mrwweb commented Aug 15, 2014

  1. The by-user-role idea personally strikes me as a weird in-between of usefulness that would be more of a compromise if not allowing per-user settings. But like you said, a good filter would allow someone to do this if it made sense for their particular site, so that's another point in the filter's favor.

@robneu
Copy link
Contributor

robneu commented Jun 29, 2015

+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.

@A-0-0-P
Copy link

A-0-0-P commented Sep 11, 2015

+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.

@alienk703
Copy link

+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.

@glennkarlsen
Copy link

+1 for collapsed by default.

@doitlikejustin
Copy link

+1 for collapsed by default. Especially when you have a lot of items in a repeater field.

@v3nt
Copy link

v3nt commented Jul 25, 2017

+1 for collapsed by default & more contrast between the rows too.

@eversionsystems
Copy link

+1 collapse by default :)

@joshuaiz
Copy link

+1 for this. And could the collapsed/expanded state be saved with the page? That would be good too.

@jartes
Copy link

jartes commented Jul 19, 2018

+1 for this :)

@joshuaiz
Copy link

joshuaiz commented Nov 6, 2018

Bumping this because I could really use this functionality 👍

@Anonymous327
Copy link

Is there a way to do this?

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

No branches or pull requests