I'm trying to include the total count of a given node type into a view tpl.php file. I would like to set this variable in the template.php file, so that it is available in the tpl.php file (that way I also don't have sql queries gumming up my template files, which I'm trying to avoid.)
I'm trying to set them the variable with template_preprocess_views_view, but the reference variable never seems to be getting updated. I did some sleuthing and threw in some dpm statements, one in the preprocess function, one in the template, and the result looks like this:
template preprocess views_view preprocess_views_view__home_image
(The thrid line prints out the preprocess function with the view name attatached)
So it looks like the issue is the template is being called before my preprocess functions, which means the variable hasn't been updated it yet, but is that correct? Shouldn't the preprocess function be called BEFORE the template is called? Is there another hook that I can use to add a variable to views-view-fields.tpl.php?