Small mod I added to this plugin
Permalink Browser Info Environment
As a front end developer/designer, sometimes I have forms that are not always exactly the same. Sometimes I have long forms where its two questions on one line, then three, then two again. Specifically in situations where you want to condense City, State, & Zip into three fields next to eachother. Its nothing super special, but I added a counter that adds a unique wrapper class to each question. You will notice in the <div class"field field-<?php echo $question['type']; ?>> I simply added:
<?php echo 'qwrap-'.$counter++; ?>">
I have included the modified view file.
This is probably already been done. But for those of you who are decent with CSS but not so good at PHP this may be helpful.
Just unzip and replace with the file in /packages/form_tableless_layout/blocks/form/templates, or create your own block template and put it in the root blocks folder with the same folder structure and name it something else. I didn't zip up the whole plugin, because this was the only file modified.
<?php echo 'qwrap-'.$counter++; ?>">
I have included the modified view file.
This is probably already been done. But for those of you who are decent with CSS but not so good at PHP this may be helpful.
Just unzip and replace with the file in /packages/form_tableless_layout/blocks/form/templates, or create your own block template and put it in the root blocks folder with the same folder structure and name it something else. I didn't zip up the whole plugin, because this was the only file modified.
Type: | Discussion |
---|---|
Status: | New |
Thanks for posting this. This is a good solution for certain situations, but be cautious of the drawback to it: you are tying your layout to the exact order of the fields in the form, so if the user edits the form block and inserts a new field or rearranges the order of them, your layout will break.
Because of this drawback, I've actually created a custom contact form addon where you just hardcode all of your fields yourself and can have complete control over the form markup:
https://github.com/jordanlev/c5_custom_contact_form...
Depending on your situation, this might also be a good solution.
-Jordan