Closed (won't fix)
Project:
Webform
Version:
6.x-3.6
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2011 at 14:51 UTC
Updated:
6 Jul 2011 at 14:05 UTC
I've read a few threads on regular support forums and am none the wiser.
I have made a new content type, and want to put a webform as a block with each instance of that content type (lets say a jobs listing).
I've worked out how to display the webform but:
How go I get a variable from each specific content type node into its related webform?
What I'm working on is here:
http://www.youthdeved.ie/development_education/talking-drum-0
Sorry if this is the wrong forum, would be glad to make a donation to any cause if anyone can advise me how to proceed.
Daniel
Comments
Comment #1
quicksketchYou cannot prepopulate any values from the webform node or the node that the block is placed on through any mechanism in the UI. See #1001798: Rewrite token replacement system to use D7 tokens.
Comment #2
quicksketchSorry wrong one: #428982: New hooks for additional token replacements.
Note that even if that feature were implemented you'd still need to have a token for something like [current-title] to get the title from the current URL instead of the Webform node.
Comment #3
quicksketchSo the short answer to this one currently is "you can't". Of course you can do this with custom coding, but such an implementation is out of scope for this issue.
Comment #4
bartezz commented@deepsoulstarfish: Not sure if our quests are similar but here is my quest and solution, maybe it helps!
I wanted to load the same webform into each node-type.tpl.php for a certain node type. In the webform I had a hidden field which I filled with the %title token so I could see from within which node the webform was send.
I created a placeholder region to my theme which wasn't being printed in the page to which I assigned the webform block. Then in phptemplate_preprocess_node in template.php I loaded the contents of this block into a $var['includedform']. In node-type.tpl.php I printed the $includeform variable which is a nicely themed webform.
But I found out that the %title token wasn't being replaced by the actual node title. So I put this in the template.php;
Problem solved! Hope it helps!!
Cheers,
Bartezz