Closed (won't fix)
Project:
Webform View Reference Component
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Aug 2011 at 14:58 UTC
Updated:
1 Feb 2013 at 15:54 UTC
Jump to comment: Most recent
Comments
Comment #1
Anonymous (not verified) commentedthis worked great. thanks.
I had to create a backup of the original .inc file.
is there a function override we can do instead? that would be a cleaner solution, IMHO.
Comment #2
d------ commentedThanks Careless,
I'm not sure but I think it will be cool if there is an added option for the module that an admin can check to enable this feature. Something like:
Select box defaults to current node title? YES | NO
But it won't be that simple as only a % of users will want to use the module this way.
Over to the maintainers ;)
Dan
Comment #3
Anonymous (not verified) commentedDan, i noticed that this is actually taking the current node, and adding the list to it, and then adding it to the selections.
is there a way to just tell the argument line you have there to select the current node if it's in the list, rather than add it to the list and then select it.
for example, if i show this as a block on the Frontpage, it shows "Frontpage" as the first selection in the drop down- when it's not even one of the results that should be showing up. Filters are set correctly, but I think the problem lies in this line:
node = node_load($nodeid);Comment #4
freakalis commentedYou can also accomplish this with a hook_form_alter(); Have a look at http://drupal.org/node/1144714 to get an idea how to solve it.
Comment #5
freakalis commentedComment #6
Anonymous (not verified) commentedI took your advice, freakalis, and I made my own hook_form_alter() function below:
This looks at the current node, finds the selection option from the select list view that is brought in and matches the value to the nid of the current page, and makes the item with the matching value as the default selection. Essentially, there are many job postings on the website, and this defaults the form block at the footer of the page to select the currently viewed job posting as the default in the form to make it easier for the user to apply.
it works great. the webform job_position changes as needed. however, I was wondering if you could help me modify it so that it ONLY gets executed if the current node id is not that of the form's node id. (i.e.- I want it to load on node 190, with form node 192 being loaded as a webform block).