I dont know if im over thinking this but im not making much progress with my function. I am trying to get the values from views rows in my modules for example if I was to use $row->field
_name inside of a view.tpl file then it would show the output of that row, except I am trying to do it in a module. Ultimately I am trying to render the image style of the 1st image that loads from the view. This is what I have so far.
function custom_module_views_pre_render(&$vars){
if($vars->name == 'front_page'){
$vars->result[0]->field_field_image[0]['rendered']['#image_style'] = 'front-page-scroll';
}
}
Update 1: I've attached a image of what I am trying to do seeing how when I use preview(); execute(); or render();
it makes the function stop working, actually it makes the whole site stop working. If I cant get to the field view result count which counts the the number a current node is then I can say if($views->view_result_counter == 1)
then render just that node. The function would look something like this.
function custom_module_views_pre_render(&$vars){
$views = views_get_current_view('front_page', 'page');
if($views->name == 'front_page'){
if($views->views_result_counter == 1){
$vars->result[0]->field_field_image[0]['rendered']['#image_style'] = 'front-page-scroll';
}
}
}
Here is a image of what I am trying to do, Now I currently have the 1st image rendering as I want it to but it keeps rendering the image of each page instead of it rendering one time only.
Now as for my view is there any reason why execute or render wouldnt work? this is what my view looks like.
any suggestions?