I've just been through a fairly painful process of theming a particular webform, and I have some suggestions that would make this easier. Note that I'm primarily focussed on CSS layout, but some of these ideas would also apply to table usage.

  1. Give each webform a distinct ID in the outer div. This would allow css selectors of the form:
    #my_form_id div.form-item {
     blah: bleep;
    }
    
  2. Allow users to specify CSS classes for fieldsets and field elements. As it is, I have to scrape the numeric elements IDs
    and embed them in php code to theme the elements. This tightly couples the form structure with the CSS, which is nasty.
  3. Show the IDs of the elements, if asked, in the design of the form.
  4. Allow forms to be exported the way that views can be exported. This would allow a complex form to be built on a 'devo' site and then staged into a production site.

Comments

davemybes’s picture

Its funny that you should ask for the CSS styling IDs, as I did exactly the same thing a little while back. I agree that they would make life much easier, but I don't think they are going to be done anytime soon. Quicksketch is the person doing most of the updates to this module and is pretty overworked these days I believe. He has made huge advances in making styling easier - you should have seen the code 2 months ago!

I might take a look at the code myself to see where the IDs you (and I) want can be inserted, but my time is also pretty tight these days, so no promises. Also I'm still a learning my way through the more complex PHP coding.

quicksketch’s picture

Thanks to bmargulies for the suggestions and incrn8 for the nice followup.

incrn8 is correct that I don't have much time to put into webform at the moment. I still greatly appreciate contributed patches whenever possible. It's easy to make the demand of someone else to do the work, but when someone puts forward a patch I know that they're serious about getting the problem fixed. So, let's see those patches!

davemybes’s picture

I just spent a while looking through the code to see where I could insert prefix and suffix codes, but I'm afraid its simply too complicated for me at the moment. I have written a module or two for some projects, but this is a whole new level.

@quicksketch, if you could maybe tell me in what function the css id's are added, it might help me focus a bit.

I guess there will be at least two functions that need modification - one to add the entry fields for prefix and suffix, and another to create them for when the form is displayed. Oh, yes, probably they would need to be added to the database too, so the insert and update functions would need some changes. Hmmm, I can see that this kind of change would be a pretty big job in the end. You know, maybe I'll just stick to themeing the form after its done :)

Anyway, I'll keep going over the code when I have time and maybe I'll be able to get something done. But for the forseeable future, I'm afraid that I won't be putting out any patches.

bmargulies’s picture

Two of my favorite missing IDs would be a trivial patch. Do you take patches from the 4.7.0 distro, or is 'cvs' substantially different?

bmargulies’s picture

Also, what do you make of:

a problem with base form theming as a related item?

quicksketch’s picture

The cvs and 4.7 branches are slightly different (cvs version has the additional post processing and validation). If you create a patch for 4.7, it should apply to both branches without a problem. Thanks!

quicksketch’s picture

Status: Active » Fixed

All these suggestions have been implemented in the 5.x version and the 4.7.x is no longer being supported.

Anonymous’s picture

Status: Fixed » Closed (fixed)