This is "sort of" a bug... This module just displays the node titles in the selection widget - unless I'm doing something wrong? Realistically, it should display all the fields as per the Views field settings. Node_reference module manages to do this, so I see no reason why this module could not also do it. I would imagine the code is there to borrow if necessary, probably directly from that module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

asak’s picture

I wouldn't say this is a bug.. more like a "by design" issue, but yea - it would be very cool to display the views fields as desired and not just the node title.

Will look into this...

NikLP’s picture

To be honest, if we could get it so that this module renders the actual view and provides a mechanism to make it into a selection widget (like views_bulk_operations does) then that would be the ideal solution I think? That provides a lot more flexibility with regard to how to present the views information (ie it comes straight from the views configuration).

sunshinee’s picture

+1

sabrawy’s picture

what ??? is that module only passing node title???? This is a big problem so what we can do we need to to replace token not just for some nodes titles.

cashwilliams’s picture

Ok, I've written code to make this happen.

Disclaimers!

  • This hasn't been very thoroughly tested, but is working.
  • This might not be code to Drupal standards, I've been a PHP programmer a lot longer then a Drupal programer :D
  • This was built off of the last release (6.x-1.0-beta2) not HEAD

Also, I have no idea how to make a patch, esp when adding new files and such, so I'm just taring up the whole module. Maybe the maintainer can sort though it :D

cashwilliams’s picture

Status: Active » Needs review
juliaset’s picture

I disabled the original module and then installed #5 to test this out, but I'm still getting just the titles, and not the view output. Is there anything else I need to do to make this work?

Edit: Nevermind! I see there's now a new checkbox in the webform to toggle the view display. Awesome! Thank you so much.

danielhonrade’s picture

#5 works, I noticed when selecting multiple checkbox, views fields don't show any more, and this is not only for #5 but for dev and beta2

jphelan’s picture

This is great. Just what I was looking for. Works great. Two questions.

1. Is there anyway to get it to also email the full value rather then just the title?
2. Is there a reason it only works with radio buttons or is there a way to make it work with a select as well?

roball’s picture

Title: Views field values are not displayed » Views field values are not displayed (Request for View Reference key|value pairs)

This issue was duplicated by #891294: View Reference key|value pairs.

stephesk8s’s picture

Finally! I've been needing this functionality forever. I seem to run into it over and over again. I can finally pull a views generated list into a webform. Thank you!

koppie’s picture

I stumbled across this while dealing with a similar problem. I have a webform in a block and I need it to pull an email address from a View and mail to that address. I'm using Webform PHP, in spite of the developer's grumbling, because it really is the most expeditious way to do what I need to do. In terms of it being a bad idea to expose raw PHP on a Drupal site, that horse left the barn a long time ago (at least on my site). The real key is only giving access to trustworthy users.

Anyway I'm using Webform PHP to load the View, get the email address, and send the email. Webform still has trouble getting the NID when it's embedded as a block, so I created a hidden Webform field and used javascript to populate it with the nid.

Hope that helps someone.

grasmash’s picture

Made modified module from #5 into patch

sunshinee’s picture

Thanks for the patch! The view rendering is working great. However, this still doesn't allow key|value pairs to be provided using a view. For example if I have a view which is rendered like...


email@mydomain.com|Node Title

CHECKBOX/RADIO output is rendered as "email@mydomain.com|Node Title" instead of just displaying the value.

LISTBOX output ignores the grouping field, rendering the node title only. However, the field is not exposed to email settings.

One other note--and please don't take this whole response to be a complaint--from a UI perspective, would it make more sense to make the View Reference an available source for the Select Options component, right below the "load a pre-built option list?"

Kind regards, and thanks again to CashWilliams and madmatter23!
Joy

stewest’s picture

I have an implementation that requires the part of this thread, where more than just the [title] field can be pulled in from the view such as [title]-[date].

I see that the patch #5 is working. May I ask when the updated module inclu. patch will be released as 6.x-1.0-beta3?

Thanks!

freakalis’s picture

Status: Needs review » Closed (fixed)

In beta3 you have the option to Display text as node title or Renderd view outout. It still only take the node title field from view but you can easily rewrite the content of that field and any data you like.

The key is still only nid/uid/tid. I can't come up with at way that let you choose your own key|label from a view. If you have a solutions for that please start a new issue and apply a patch.