Maybe this should be handled within Webforms or maybe this should be done in a seperate module, I don't know.

But a menu that gives you the ability to create "prebuilt" lists would be absolutely incredible. At the moment lots of people are just using a notepad and copy and pasting the same list for data integrity, and it would be good to remove the need for that and the risk of different data. Exporting and importing those lists would just be icing on the cake.

I imagine the menu would look very similar to the creation of a select component, only without a safe key field and other form related options. So I guess really just the name of the list and "Options" text area.

CommentFileSizeAuthor
#2 11-05-2010 10-15-27 AM.png17.29 KBhealthent
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

While this is definitly possible from the API stand-point (we have a hook specifically for creating pre-built lists), I'm not sure where this would go in the UI or if it should be built into Webform directly. This issue would probably reduce the need for this at least at some level: #767290: Allow Views to be used as pluggable select list values.

healthent’s picture

FileSize
17.29 KB

Why not here as a tab? It's where you set all the other similar sitewide options so it makes perfect sense to me? (By that I mean that is the first place I would click to if this feature existed and I was searching for it)

quicksketch’s picture

Version: 6.x-3.0-beta5 » 6.x-3.x-dev

I'll keep this open as a feature request for others to chime in, but I don't have any sort of timeline for implementing and I'm unsure whether this should be added to Webform core.

vinmassaro’s picture

This would be helpful as we are looking for a way to reuse webform components (a long select list for instance) that have to be rebuilt each time for a new webform.

bayousoft’s picture

Can I manually create pre-built lists somewhere? Where are the default lists (days of week, states) created/saved? Love the webform module.

bayousoft’s picture

NM Found them in ...webform/includes/webform.options.inc. Would you be interested in including addtl popular lists?

quicksketch’s picture

@bayousoft: I'll consider some lists, but I think 90% of people's requests would be met by #767290: Allow Views to be used as pluggable select list values. You can add your own lists in a custom module by implementing hook_webform_select_options_info(). See webform.hooks.php.

vinmassaro’s picture

I think both techniques listed are too complicated for most users. I know in our case, the person wanting to create lists will not be able to do this in Views and would benefit greatly from either the reuse of components across multiple forms, or the ability to create lists.

bayousoft’s picture

Would the "Country codes API" module be required to access the "countries" pre-built list as currently written?

bayousoft’s picture

Well, you would certainly know better than me. My fear with a view is that there would too much addtl overhead for what we are doing.

Thanks.

quicksketch’s picture

I think both techniques listed are too complicated for most users.

I'm not saying that other options aren't out there, but I think it's unlikely that I'll include a list-creator interface in Webform core. A separate module could easily provide an easy-to-use interface or allow reuse of existing lists. Any module can provide pre-built lists.

Would the "Country codes API" module be required to access the "countries" pre-built list as currently written?

Yes. If you have Country Codes API it automatically becomes available. In D7 this is not necessary since it has a native list of countries built into core.

bayousoft’s picture

I switched all new development over to Drupal from Coldfusion about 6 months ago. I can see myself using this module for just about every client so I should be able to contribute a "webform pre-built list" module. Otherwise, I could be in the code here quite a bit.

luketsimmons’s picture

Hi guys,

Hopefully I'm not steering this off topic but it is related and will hopefully get more eyes on it than a fresh issue. I noticed that while the pre built list hook appears very helpful in principle, it doesn't seem to work as expected?

The current call in _webform_edit_select() (in components/select.inc), where the prebuilt lists are shown when adding/editing a select field, is for _webform_select_options_info() which isn't a hook invoke, it's just the default prebuilt options (days, states and countries).

This means you can create a custom hook, but it will never get called? Or am I missing something?

Thanks,

luke

luketsimmons’s picture

Scratch that I'm being a dunce... it is invoking via _webform_select_options_info() I saw _webform_options_info(), which is the default private function for the pre built options.. it's just not invoking for my module, can't see why though, caches cleared, custom module is functioning fine...

Ah well back to the drawing board. Apologies for butting in!

Thanks,

luke

ajaysolutions’s picture

What the OP and bayousoft are suggesting sounds perfect as a module for Webform (although I would like to see it in Webform core). I'm using Webform today for the first time ever, and it's wonderful. I'm using D7, and recreating a form for UK addresses. I found the Webform Validation module, which will be perfect for using regular expressions to validate UK postcodes, but I was looking for a list of UK counties for a drop-down in my Webform.

I decided to create my own piped list with groups for England, Wales, Scotland and Northern Ireland, and stored this in a document in the cloud for future reference (as I'll doubtless need this for lots of sites).

When I scrolled further down the page, I then noticed "Load a pre-built option list", which doesn't include UK counties, but that started me on this afternoon's Google hunt for creating Webform pre-built option lists... which lead me here.

To have somewhere where lists can be saved, imported and exported would be extremely useful in the Webform UI, without needing to touch PHP.

Please (re)consider :)

Many thanks, quicksketch, for an otherwise very useful and practical module!!!

oscarjgarza’s picture

+1 for this module / core update.

DanChadwick’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

There won't be further feature development in the X.x-3.x branches.

jrwilson’s picture

Perhaps a simplified way for site builders is to use: values

DanChadwick’s picture

This post indicates that the 'webform views select' sandbox may become a module.
http://www.mediacurrent.com/blog/contrib-committee-progress-report-janua...
This would be for webform 7.x.