When I enable this module my select fields look like this within my theme (not in the admin theme) - i this the expected function?

http://snag.gy/kkcC1.jpg

I'm using Boostrap 3.0

CommentFileSizeAuthor
#4 bootstrap_chosen_form.png23.86 KBjohnkareoke
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mabo1972’s picture

Hi stopshinal,

i had the same problem. Take a look at chosen Bootstrap 3 theme

Hydra’s picture

Sweet, perheps we can add this to the documentation of the readme file? Patch is pretty welcome!

johnkareoke’s picture

I'm experiencing the same problem and I'm not sure how to implement the chosen Bootstrap theme? Where do I place the chosen-bootstrap.css file? in the sites/all/libraries/chosen or in the Boostrap theme folder?

I am also using the Bootstrap 3.0 theme

Chosen.png

Thanks in advance.

johnkareoke’s picture

FileSize
23.86 KB
radziaziz’s picture

In reply to #3, here is what i did.

1. Download chosen-bootstrap.css from https://gist.github.com/koenpunt/6424137 and put it in my theme folder and then update theme .info file to include that css. (Or you can just overwrite chosen-drupal.css in chosen module folder)

2. Include following code in your css (in my case, my theme's style.css)

.chosen-container {
border: 0 !important;
padding: 0 !important;
height: auto !important;
box-shadow: none !important;
-webkit-box-shadow: none !important;
}

i'm sure there are better ways to do but this this is the easiest that i manage to think. Please review and update me, as im am still newbie.

markhalliwell’s picture

Title: Weird styling? » Integrate Chosen module/library styling
Project: Chosen » Bootstrap
Version: 7.x-2.0-alpha4 » 7.x-3.x-dev
Category: Bug report » Feature request
Priority: Major » Normal

This is indeed specific to Bootstrap, so I'm moving it there. I like the gist :D I've done something very similar (manually) in my own projects, but nothing this sophisticated or extensive. I'm bumping to a feature request (since this is new code) and also resetting priority (since there is currently a solution, albeit a manual one).

This could easily be automated though so this extra CSS is only included when a certain file is detected. I think I'll need to extend bootstrap_css_alter() to function similarly to bootstrap_js_alter(), which handles the replacing/appending of JS based files.

I welcome patches :D

kingfisher64’s picture

@radziaziz - thank you very much for that. A quick solution. :)

pheraph’s picture

This is still an issue with the theme. radziaziz‘s CSS code fixes it.

pheraph’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Category: Feature request » Bug report
jorgediazhav’s picture

Version: 8.x-3.x-dev » 7.x-3.x-dev

This was accidentally moved to 8.x. Moving it back.

markhalliwell’s picture

Status: Active » Closed (outdated)

Not enough interest.

pheraph’s picture

Hm, why is it tagged as outdated? Occurs with 8.x, too and should remain active, shouldn't it?

markhalliwell’s picture

Category: Bug report » Feature request

Because it's a feature request and as I stated in #11, "Not enough interest.".

hass’s picture

Status: Closed (outdated) » Active

Comming from #2834688: Chosen fields not growing automatically with the content

You pointed me to https://silviomoreto.github.io/bootstrap-select/, but I'm not sure how this works. I see Live search that may work like chosen if it comes to search/autocomplete, but I cannot see how to select a large number of items one after the other? I have 10K and more nodes / taxonomy terms behind my chosen autocomplete fields. Users need to select some of them.

I think there is still a need to support this and there IS interrest.

hass’s picture

Looks like there is a lot of info and working code in https://gist.github.com/koenpunt/6424137. We just need to take all over, combine some additional comment and add it here to the theme.

markhalliwell’s picture

Status: Active » Closed (won't fix)

https://silviomoreto.github.io/bootstrap-select/ is fine for smaller/basic implementations, yes. For larger/autocomplete style, you can also use the https://github.com/truckingsim/Ajax-Bootstrap-Select plugin (extends on top of bootstrap-select). I know this works because I co-maintain Ajax-Bootstrap-Select.

I'm closing this because, quite frankly, there isn't enough interest nor should it be added when a site that doesn't actually use chosen (wasted CSS).

I have integrated chosen on a bootstrap site before and I added the above gist (with some heavy modifications) to my sub-theme just fine. IMO that's where these kinds of additions should live, not in the base theme.

hass’s picture

Status: Closed (won't fix) » Active

That does not look like a ready-to-use Drupal solution like chosen is. No idea how this work. The links you shared are not working like chosen with 20 selected items. I'm not looking for a single ajax search field. I need to select 50-100 nodes in this select field. Without chosen it is a autocomplete with comma separated items. Not sure if you really seen this?

Aa

The base theme can easily and need to support everything that has a high usage. Chosen seems to work well if the missing css is added. A module with 50.000 installation is really important and need to be supported. Modular code only need to be loaded / added in the theme if chosen is an enabled module in an installation.

50k installs show that it is important and there IS A LOT OF INTERREST. Please do not close cases just because you are personally not interrested, but many community members are.

markhalliwell’s picture

Title: Integrate Chosen module/library styling » Create a "chosen" @BootstrapPlugin
Version: 7.x-3.x-dev » 8.x-3.x-dev
Status: Active » Postponed
Related issues: +#2550491: Create @BootstrapPlugin annotated plugin

That does not look like a ready-to-use Drupal solution like chosen is.

No, it doesn't have a module you can "easily install". It's a plugin you have to manually implement in your sub-theme.

No idea how this work.

Not really this project's problem, now is it. You can't have everything working with everything else "out-of-the-box". You should know that, you've been around long enough.

The base theme can easily and need to support everything that has a high usage.

A common misconception. Just because it's "high usage" does not mean it will actually work (well) with this base theme. The fact that there has to be custom CSS generated is proof of that. This just adds more overhead to this project to officially "support" more code. It's a balancing act, one that has to be considered carefully.

A module with 50.000 installation is really important and need to be supported.

A module's reported installs do not indicate any sort of "interest" in a specific Bootstrap implementation for said support.

Modular code only need to be loaded / added in the theme if chosen is an enabled module in an installation.

Which is something you can easily add in a sub-theme.

Please do not close cases just because you are personally not interrested, but many community members are.

It's not that I'm not "personally interested". As I stated above, I have used Chosen with Bootstrap. So I know it's certainly doable. That isn't the point.

The point is that there are many different types of solutions out there for this particular "problem". Having the base theme take a stand one way or the other is rarely a good "solution". This is similar to the "policy" this project has adopted for Display Suite vs. Panels. It doesn't provide layouts for either because they're two very different workflows/implementations.

If, like in 8.x, there becomes a method for which to standardize these kinds of "different approaches" (like was done for both DS and Panels with bootstrap_layouts), I will consider adding support.

In fact, the possible creation of a @BootstrapPlugin annotated plugin might help with this, at least in 8.x.

For 7.x, this kind of "support" is fine to leave in a sub-theme implementation.

---

For the record, I don't appreciate the attitude towards a project you're just now getting involved with. There are reasons why things are the way they are, the least of which is my availability. About 98% of people that use this theme don't actually contribute code back to it. That leaves, essentially, only me to support every aspect of it. If you don't like something, or on your special time table, then provide a patch .

markhalliwell’s picture

Version: 8.x-3.x-dev » 8.x-4.x-dev

Don't think this is going to happen for 8.x-3.x either.

shelane’s picture

Status: Postponed » Closed (won't fix)

This theme will not be supported for Bootstrap 4. See alternative themes for this support.