Since my Webform has a column of 132 selections and I am unable to make trickery with CSS finding this module was a relief. Until I tried implementing it.
I am lost at the opening sentence. What is meant by "In the definition of form element checkboxes/radios, add the '#multicolumn' property". I understand that a new form component type named '#multicolumn' is created but exactly which file is the php snippet inserted?
In the section Webform usage it instructs creating a module and adding a hook. If I've downloaded the module why do I need to create one?
In the section Note to module writers it is mentioned "you can add multi-column settings to your checkboxes/radios without dependency to this module. For sites that have this module enable, your checkboxes and radios will be in muti-column."
That says to me that the module takes care of inserting code snippets. I dunno, that is why I am asking for clarification.
The Webform examples, including php snippet, edit individual nodes. If the module is implemented correctly does it apply to all Webforms or is the user required to implement at the node level.
I am not pointing out fault with instruction, they likely make perfect sense, but as you can tell I am very confused.
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | example.jpg | 9.94 KB | ingrid888 |
| #9 | mccrw.tar_.gz | 683 bytes | haplo326 |
Comments
Comment #1
mattyoung commentedIf you don't know how to write a module, then those instructions won't make much sense. It's not hard. But you have to overcome this one step at a time.
There is no way to make this work in webform with just point and click. But the form_alter() hook is a very standard thing with Drupal and not hard. But it's write a little module.
So figure how what that hook_form_FORM-ID_alter() is and how to make a little simple module to implement this hook.
Or you can make a feature request to the webform module to add the multicolumn options settings needed by this module. With that, then checkboxes/radios in webform will show up in column automatically.
Feel free to move this thread to the webform module issue queue and make a request there.
Comment #2
manogolf commentedThanks Matt,
I will pursue both options; move to Webform issues and attempt writing a module. Really it's about time I open the hood and take a look.
Comment #3
manogolf commentedHi,
Moving this thread over from Multi-column checkboxes radios.
Has anyone implemented this module by creating a module as instructed at http://drupal.org/project/multicolumncheckboxesradios
Searching Webform issues does return similar requests and this seems an ideal solution.
Following these instructions is beyond my current abilities but I will be making a run at implementing, as this is the solution to my issue. Of course anyone in the know is invited to jump in and save me from myself.
Wish me luck.
Comment #4
manogolf commentedComment #5
manogolf commentedComment #6
manogolf commentedhmmmm, I was really hoping for some interest by others in being able to display your list in multi-column.
My attempt at hacking code together and using from additional validation performed as expected; unfavorably, nothing, zip.
I'll give it another shot this week and hopefully have something that can be shared.
Comment #7
haplo326 commentedHello,
I can feel your trouble bro. I have the solution for you after spending all day on this. I too am new to drupal and the instructions for using this module are incomplete/inaccurate. To get this module to work properly with the webform module you would follow the steps provided for the most part. When it comes to creating your own module I assume you have read about how to do this. If not here is the tutorial I used since I had not worked with drupal modules before. (http://technosophos.com/content/packt-creating-our-first-module-using-dr...). Basically, the only difference's are:
1. The hook_form_FORM_ID_alter function of your script should not start with hook, but a name unique to your module.
2. The line "$form['submitted']['cooking_methods']['#process'][] = 'multicolumncheckboxesradios_element_process';" should be omitted.
Here's an example from my working module.
function form15_form_webform_client_form_15_alter(&$form) {
$form['submitted']['armpain']['armpain0']['#multicolumn'] = array('width' => 6, 'row-major' => TRUE, 'minimum height' => 1);
}
NOTE: my fields are contained within fieldsets so the path becomes ['submitted']['fieldsetname']['fieldname'] instead of ['submitted']['fieldname'].
The good part about this is you only need one line per field instead of two now.
Comment #8
haplo326 commentedHello,
Manogolf, I realized on my way home today that my instructions are also incorrect... In step 2 where I said to omit the second line is incorrect... It will not work with this line but you will need to include that line the first time you open the form so that function (multicolumncheckboxesradios_element_process) gets added to those objects (your fields) so they are formatted correctly. You will not see any options! Then remove the line and refresh the form and you should have your columns... If you need to get your form going now you can use these instructions provided... due to the difficulty involved with thise I may create a module to format all the fields the same on any webform using this module. Sorry for any confusion and I wish you luck in getting this going.
Comment #9
haplo326 commentedHello again,
I'm new here so don't know where to upload this exactly or if I can but here is a module to integrate the two modules. This will fix your issues, you will need to edit it now to set the number of columns and other settings. If you're like me then your form is massive and you don't want to add all those lines for each field.
Comment #10
haplo326 commentedComment #12
manogolf commentedHaplo326,
You probably have concluded I must be an ungrateful slob for not responding. Truth is I've had my head down for weeks creating a css file for a theme. I'm very slow to finish a project.
Needing a break I looked up today and found you responded to this thread. Man am I ever appreciative. I haven't actually applied your solution yet and will take a look into making this work today.
I'll let you know if I get it working!
Comment #13
manogolf commentedhaplo326,
You hand tailored this module with the most important feature I know of. It's idiot proof!
This is so great. All that is required is upload and activate. I can't thank you enough :)
Do you have a tip jar anywhere?
Comment #14
haplo326 commentedmanogolf,
Your appreciation is thanx enough. I have already been compensated through my employer for creating this module. I knew you needed help from looking for such a module myself so sharing is half the fun :) I did notice in other posts that you sometimes require help and I may be available at times. You can email me @ aim.com.
Again I am glad I was able to help.
Comment #15
quicksketchUpdating title to reflect issue request. No new features are being added to the 2.x version, but this seems like it would be a good long-term feature to have implemented.
Comment #16
steve02476 commentedI just tired out the two extra modules, http://drupal.org/project/multicolumncheckboxesradios and the one attached to message #9 above. They work great, all I had to do was enable both of them and do a tiny bit of editing on the MCCRW module to change the direction. Thanks very much!
Comment #17
vnadasan commentedhaplo326,
I just wanted to thank you for creating and sharing this extremely useful module.
mccrw should be on the Drupal module list.
Comment #18
steve02476 commentedAs above, I'm using multicolumncheckboxesradios and mccrw in tandem for my webforms.
Maybe this is obvious, but if I have two webforms on my site can I have the multicolumn used on one form and not the other?
For that matter, can I use them with one Select component and not with a different Select component on the same form?
Comment #19
kahall commentedJust found this and needed it badly. Thanks haplo326. Awesome!
Comment #20
Hitmrrr commentedHi,
#9 work with new version 6.x-3.1 ???
Comment #21
Hitmrrr commentedHi!
In one line radio buttons work only when i use "multiple" (checkboxes) how to make what would have happened in one line and at the same time, i could choose only one value?
Comment #22
Anonymous (not verified) commentedHat tip to you haplo326 !
Such a relief that some one else has waded through making a module out of the information on the MCCR project page, for those of us who don't yet speak the language of Drupal code proficiently.
Thank you.
Comment #23
mattyoung commentedI added support of this in the Multi-column checkboxes radios module and is in the 'dev' version there. However, the implementation depends on the patch in #946956: Implement alter() hook to allow external module to extend existing components?.
If you apply the patch in issue 946956 and use the 'dev' of multicolumncheckboxesradios, you will get a configuration fieldset for multi-column in the 'Display section'
Comment #24
gjangelo commented"and do a tiny bit of editing on the MCCRW module to change the direction. "
steve02476.....
How did you change the direction? I'm assuming that the values now fill in column first, then rows?
anyone....
How would i get this to apply formatting to only certain fieldsets on certain forms?
I'd like to format the checkboxes in the fieldset "states" on the node 53 webform, but no where else. How would I modify the code to limit the module from affecting other forms, as well as other checkboxes on node 53?
Comment #25
stevenator commentedIs it possible to check the $node->nid in your form alter?
Comment #26
unimarkt commentedHow is it possible to run the module with Drupal 7.x ?
I just changed in mccrw.info the line
core = 6.x
to
core = 7.x
and became after core-running:
"Notice: Undefined index: submitted in mccrw_form_alter() (Zeile 26 von /home/www/web72/html/delta/sites/all/modules/mccrw/mccrw.module)"
Best regards, Thanks!
Comment #27
colorMe commentedhaplo326,
How can I make the multicolumn checkbox to apply on certain forms only?
Comment #28
mattyoung commentedI had a patch to the webform D6 somewhere that enable direct support there. Look it up. There is no D7 webform support.
Please do not change version number in this issue :) let's use this is for discussion pertaining to the D7 port.
Open another issue if you still cannot figure out to do this.
thanks!
Comment #29
ingrid888 commentedCan i control the spacing of radios that are placed in the row. For example, If i have 2 radio options, they spread out along the whole line, but I prefer to have them aligned tightly left. is this possible?
Comment #30
mattyoung commentedYou can use CSS to control the width of the table cells
Comment #31
danchadwick commentedClosing for lack of activity. There is a grid component, and there is another issue for a multi-select grid component.
At this point, 7.x-3.x is receiving critical bug fixes only. Please update to 7.x-4.x.