how to pass variables from a views style-template to the row-template it invokes I created a custom style-plugin for views, and a corresponding style-template (my-style-template.tpl.php).
Similarly, I created a custom row-plugin for views and a corresponding row-template.

The style-template loops through the views-rows, and invokes the row-template on each row:


print $row;


What I am trying to accomplish:

The style-plugin defines certain settings in the $options variable, which gets passed to the style-template.  The row-template needs access to some of these settings.

My question:

Is there a way to pass variables from my style-template to my row-template?
For example, rather than invoking print $row from the style-template, is there some other way of invoking the row-template, which allows me to pass variables to the row-template?

Thanks very much!
You can't pass variables from one template file to another.  That is not how things work.

However, a general rule is that every template file has a corresponding preprocess function for creating the variables available in the template.

So, you need to figure out what preprocess functions are being called.  The Theme Developer module can help out with this.  The theme.inc file lists all of the preprocess functions that the Views module uses.

With those, the standard way of handling things is something like

function mymodule_preprocess_views_view(&amp;$variables) {
  $view = $variables['view'];
}


Once you have the $view object, you have everything you need.  However, you often need to dpm($view) to figure out what is there and/or look at the default preprocess functions.