Module Description
It provides a toggle widget for Boolean field type using bootstrap toggle library (For more information about the library visit this page: http://www.bootstraptoggle.com).
This widget comes with a lot of options to make your toggle button look more attractive.
Similar projects and how they are different
Toggle
- Toggle module is compatible only with drupal 8 dev version also toggle module is based on deprecated hooks, whereas bootstrap_toggle module makes use of Field widget APIs which is a complete new implementation than toggle module.
- Toggle module does not use bootstraptoggle library hence does not provide as much options as bootstrap_toggle does to customize the look and feel of widget.


Change the label of toggle like this

Change the size of toggle

Customize the size by providing width and height accordingly

Switch between these colors also

Installation
1. Download and enable this module.
2. Check Status report of your site, you will see a message there saying bootstrap_toggle library missing.
3. Download bootstrap toggle library from here: https://github.com/minhur/bootstrap-toggle/archive/master.zip
4. Place this library under libraries folder in docroot and rename this library folder to 'bootstrp_toggle'

5. Check Status report of your site and you won't see that message again.
Usage Steps
1. Create a content type and add a Boolean field in it.
2. Click on 'Manage form display' tab and under widget column select 'Bootstrap Toggle' as the element display widget for your field.

3. Configure the settings for that toggle button and update those settings.

4. Now save the content type settings form and you are done.
Try out different combination of settings to get a different look of toggle button.
Requirements
1. Libraries
2. Bootstrap 3 Theme (Content add/edit page must use bootstrap in order this widget to work properly)
Project Page
https://www.drupal.org/sandbox/abhishek_pareek/2751487
Git Clone:
git clone --branch 8.x-1.x https://git.drupal.org/sandbox/abhishek_pareek/2751487.git bootstrap_toggle
cd bootstrap_toggle
PAReview:
http://pareview.sh/pareview/httpsgitdrupalorgsandboxabhishekpareek2751487git
Manual reviews of other project:
1. https://www.drupal.org/node/2704759#comment-11309225
2. https://www.drupal.org/node/2595919#comment-11309219
3. https://www.drupal.org/node/2748429#comment-11309199
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | coder-results.txt | 4.51 KB | klausi |
| #14 | configure_bool_field.png | 19 KB | abhishek.pareek |
| #14 | click_manage_form_display.png | 30.02 KB | abhishek.pareek |
| #14 | library_placement_expanded.png | 26.68 KB | abhishek.pareek |
| colors.png | 4.42 KB | abhishek.pareek |
Comments
Comment #2
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
nikhil banait commentedHi @abhishek.pareek,
Manual Review
Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
No: Causes
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
I guess this module is duplicating with https://www.drupal.org/project/toggle. Please provide your inputs on how this module is different.
This review uses the Project Application Review Template.
Comment #4
klausi@nikhil: I think you forgot to change the status. Is this now RTBC after your review or are there application blockers left and this should be "needs work"?
Comment #5
pookmish commentedMy suggestion, you can drastically reduce the amount of code and remove the dependency on libraries if you just reference the CDN versions of the libraries. This will also remove the dependency on the bootstrap theme. I for one, have no desire to use bootstrap or build a custom bootstrap admin theme simply to support this module. The patch I'm supplying reduces the number of files and the amount of code needed for the settings.
Otherwise it seems to be a little more customizable than https://www.drupal.org/project/toggle.
Comment #6
nikhil banait commentedBy looking at pookmish patch, this project required some work. So marking this issue status as "Needs work".
@klausi Sorry, I was not sure about changing the status, as I just wanted clarification regarding duplicate module.
Comment #7
gisleThere already exists some modules that implement toogles for Drupal. Here is a list with those I am aware of:
We prefer that our users are informed about possible functional overlap. This should be made is section with the heading "Similar projects and how they are different" on the project's project page that:
Please note that we don't block applications over duplication. However, it is considered polite to inform users about the alternatives. Please take a look at the project page template and add the section "Similar projects and how they are different" to your sandbox project page.
Comment #8
abhishek.pareek commentedHey All,
Thanks for your suggestions and reviews.
@nikhil: Well yes it is similar to Toggle module but it does provide some cool new options which that Toggle module doesn't.
@pookmish: I don't think we should force people to use library from any cdn directly, what if someone doesn't want to load libraries from cdn, thanks for your patch but sorry I can't include it.
@gisle: sorry I was already aware of those modules but didn't mentioned them earlier. Doing it now !
PS: Apologies for late reply !
Comment #9
abhishek.pareek commentedComment #10
ikit-claw commentedHi just a quick one.
You need to set the Git default branch
Take a look at the Drupal guide on it here https://www.drupal.org/node/1659588
Comment #11
klausi@ikit-claw: setting the default branch is a good tip, but surely not an application blocker. Anything else that you found or should this be RTBC instead?
Comment #12
ikit-claw commented@klausi Sorry very new to this I thought it was a requirement. I will have another play with it now and post any issues I find.
Comment #13
ikit-claw commented1) You haven't set the default branch if I just do a pull I get an empty repo.
2) The installation process is confusing. I would recommend you take screenshots of the entire process.
3) update the readme file accordingly
4) also it is looking for Libraries but other modules look for libraries so you are going to have a conflict possibly if someone else uses a module that specifically calls for a lowercase libraries folder.
other than that I get no issues or errors.
Comment #14
abhishek.pareek commentedComment #15
abhishek.pareek commentedComment #16
abhishek.pareek commentedThanks a ton for your review @ikit-claw !
1) I have set the default branch to 8.x-1.x
2) Updated the readme file and provided a few screenshots for installation and configuration process.
3) But for your last point I would say, this module already search the bootstrap_toggle library inside "lowercase libraries" folder only and not "Libraries" folder, you can confirm that by moving the desired bootstrap library from "libraries" folder to "Libraries" folder and then check "Status Report" page, you will find a warning there saying 'missing bootstrap_toggle library'.
Comment #17
ikit-claw commentedCool I am updating my theme today I will have a look at your module again tomorrow all going well :)
It's a race now ;)
Comment #18
dtraft commentedCool module - I do love me some bootstrap :)
Automated Review
Looks good, just some minor formatting issues around lines and line lengths: http://pareview.sh/pareview/httpsgitdrupalorgsandboxabhishekpareek2751487git-8x-1x
Manual Review
This review uses the Project Application Review Template.
Comment #19
abhishek.pareek commentedHey thanks a lot for your review @dtraft,
1. Well I have corrected those formatting issues: http://pareview.sh/pareview/httpsgitdrupalorgsandboxabhishekpareek2751487git
2. As far as that toggle module is concerned, I have check it and found that this module is not working with new drupal 8 versions and when I looked at its code I found that whole toggle module is based on deprecated hooks, whereas I have used field plugin to build bootstrap toggle module which is a complete new implementation plus it gives a lot more customization than that one.
Hope this suffice !
Comment #20
gisleabhishek.pareek posted:
You've posted this in the wrong place. Please read the guidelines for the project page template again: https://www.drupal.org/node/2190239 - in particular, notice that the section "Similar projects and how they are different" is missing from your project page.
(This is your project page: https://www.drupal.org/sandbox/abhishek_pareek/2751487 .)
Comment #21
abhishek.pareek commentedComment #22
abhishek.pareek commented@gisle: Thanks you very much for reminding me about this again :)
I have updated both project page and this project application.
Comment #23
abhishek.pareek commentedComment #24
abhishek.pareek commentedPlease someone/anyone review/promote this module ????
Comment #25
klausiReview of the 8.x-1.x branch (commit 5e48e2a):
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
Otherwise looks good to me.
Thanks for your contribution, Abhishek!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #26
abhishek.pareek commentedThank you very much @klausi :) and all people for their valuable time.
@klausi: I will fix those drupalpractice issues.