Closed (cannot reproduce)
Project:
Views Embed Form
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
22 Dec 2009 at 04:50 UTC
Updated:
18 Aug 2010 at 21:57 UTC
I'm a newbie to drupal and PHP coding.
I have a simple php script that is passed 3 values from node CCK fields in a table view.
I'm taking a look at the sample vef_test_form provided, but can't figure out how to pass the CCK field values to the function.
what functions do I use to get the other row values for:
$form['xxx'] = array ( '#value' => ???
Any help would be greatly appreciated!
Thanks.
Comments
Comment #1
mettam commentedI also am having trouble figuring out how to access the content of the fields in the row. I've looked at the documentation and the example and tried this:
function time_off_approval_form(&$form_state, $row) {
$form['pto_id'] = array(
'#type' => 'value',
'#value' => intval($row->entry_ID),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Approve'),
);
return $form;
}
But that doesn't read in the value that I need. Am I missing something?
The form is there, and it sends a message, but it's not able to access the data I need.
Thanks for any help you can offer.
Comment #2
meba commentedWhat is "entry_ID"? There is no such field in views. Don't you mean $row->nid?
Comment #3
mettam commentedNo, because my view isn't a node view. Does the VEF only work for node views?
Comment #4
meba commentedSorry for a delayed comment. You can always do something like dpm($row) to check what fields you have available.
VEF was designed with Node views but nothing really prevents other types from succesfull operation, there is just going to be a different field, find it using Devel dpm() function.