Hello and thanks the boostrap Toogle module.
Problem/Motivation
I was quite upset on installing this module : It provides a greate widget on editing pages but does not provide toogle visualization on view pages. IMHO the big advantage of a toogle is to quicly see the status of the checkbox.
Steps to reproduce
The toogle that appears on the entity edit page does not appears on the entity view page.
Proposed resolution
A bootstrap toogle formatter
Remaining tasks
Review, patch provided. It works for me.
User interface changes
Add a new formatter (always "Bootrap toogle") for boolean fields on the entity view display page, with the same options than the widget.
API changes
Nothing.
Data model changes
Nothing.
Note : this may (or may not) breaks the quick edit module on the boolean fields using the boostrap toogle formatter. I didn't test it.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | BootstrapToggleFormatter-3258043-11.patch | 1.39 KB | jordik |
Comments
Comment #2
thedut commentedPatch uploaded.
Comment #3
thedut commentedComment #4
thedut commentedComment #5
bennos commentedthis works nice
Comment #6
waynelevin commentedSurely the purpose of 'toggle' is to be able to easily set the boolean value from a view (seems you have this 'toggle' functionality disabled for views) which is our primary use case (and NOT in the 'edit' form).
This was our solution but it seems the module is not being maintained for 9.3: https://www.drupal.org/project/toggle_editable_fields
Thanks for the patch so far!
Comment #7
thedut commentedHello !
Yes I didn't imagine using the toogle throught views. This is a great idea.
Thanks for pointing me this module.
Comment #8
jordik commentedChecked the patch #2 - it works as expected. Did some coding standards changes, here is a new patch, wich will be committed.
Thank you @thedut, nice work!
Comment #10
jordik commentedComment #11
jordik commentedWhile changing the name of the variable one instance of it remained unchanged leading to errors. Corrected patch included.