Hello. Let's see if someone can help me to solve this issue. I've been looking all around and I have not found anything related. I choosed Bootstrap theme to run a personal project. I have seen that this theme has the option to enable tooltips wich is specially good for the form's descriptions. But it does not work in webform. It does in drupal default's forms. What can I do to be able to enable this tooltips in webform's descriptios?? any suggestion?

Comments

quicksketch’s picture

What can I do to be able to enable this tooltips in webform's descriptios??

Webform uses different theme functions for its form elements than Drupal core. You may need to override theme_webform_element() to match whatever Bootstrap theme is doing to theme_form_element().

Finabluma’s picture

Hi, first of all thanks to quicksketck for you suggestion. I guess that could be the way. I have been looking all around and trying with some code without succeed. To be honest I have to say also that I'm not a php expert, I know how to read it but not 100%. Still there is some troubles to write and understand this language. But i will not deserve. Where might be the solution?
I have notice that webform module has its description a part of the div webform-component. The forms where the bootstrap tootip works have the desription converted from title to data-original-title in the parent div of the form elements...Probably that means something, probably not. I don't know and still completely lost :(

quicksketch’s picture

Status: Active » Fixed

Hi @Finabluma, sorry I didn't get back to answering this question. Support requests around coding or theming are outside the scope of questions I normally answer in the issue queue.

This is an issue of basically copying an existing theme function into your current theme's template.php file. Find the entire theme_webform_element() function in the webform.module file, copy and paste this into your theme's template.php file. Then replace the word "theme_" with the name of your module. Now you can modify theme function to do whatever Bootstrap's theme is doing. You'll need to clear your caches to get the new function to be recognized.

However, rather than you doing this individually, maybe it'd be better if Bootstrap did the work for you as part of the functionality of that theme. It looks like Bootstrap has been working to integrate with Webform recently (from #2150725: Webforms are missing .form-group), so you might just be able to update the Bootstrap theme and be done with it.

I'm going to mark this as fixed since this issue is several months old. The solution at this point is probably just to upgrade the theme.

Status: Fixed » Closed (fixed)

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