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.

Comments

thedut created an issue. See original summary.

thedut’s picture

StatusFileSize
new3.66 KB

Patch uploaded.

thedut’s picture

Issue summary: View changes
thedut’s picture

Issue summary: View changes
bennos’s picture

this works nice

waynelevin’s picture

Surely 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!

thedut’s picture

Hello !

Yes I didn't imagine using the toogle throught views. This is a great idea.
Thanks for pointing me this module.

jordik’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new3.63 KB

Checked 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!

  • JordiK committed bd49dc30 on 2.0.x authored by thedut
    Issue #3258043 by thedut, JordiK: Boostrap Toogle on View display page (...
jordik’s picture

Status: Reviewed & tested by the community » Fixed
jordik’s picture

StatusFileSize
new1.39 KB

While changing the name of the variable one instance of it remained unchanged leading to errors. Corrected patch included.

  • JordiK committed 688e6e0a on 2.0.x authored by thedut
    Issue #3258043 by JordiK, thedut: Boostrap Toogle on View display page (...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.