[support] Some guidance with views needed

Nik Derewianka nik at artofmultimedia.com.au
Thu Jun 17 01:41:45 UTC 2010


On 16/06/2010, at 12:26 AM, Michel Morelli wrote:

> Nik Derewianka ha scritto:
>> What I am having trouble with is knowing where to add the code to modify this result.  So far i have been trying to insert this via template files without much success:  I can see that the Company drop down filter has node id's in the #value that would allow me to do a node_load, but this seems to only be available in views-exposed-form.tpl.php and doesn't seem to allow me to output the node information before the rest of the view.
>> 
> Hi, You need to use hook_form_alter() to alter the view's form before 
> it's rendered.

Okay i seem to be making some progress, i have made my own module, hook_form_alter is being called, print_r() on $form and $form_state show me lots of tantalising information, but it doesn't show the currently selected value for the exposed filter dropdown - is this because I am using ajax for the form and it is therefore not showing up in the form_state ??

Also, just to test the output, i did a straight hardcoded node_load(..), by printing the node->body and understandably it prints the content out before the rest of the rendered page.  I assume that i have to insert it into the output of the view somehow, would this be by modifying the $form variable and inserting the appropriate array information?

Am I on the right track here ?

Thanks,
Nik


More information about the support mailing list