Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am using $static to add the value of each row so in the end I have a sum of all rows. I would like to print this out in my views footer or in my template somewhere. How can I get the variable in $static out of my row and make it available to the rest of the view?
Comments
Comment #1
gthing CreditAttribution: gthing commentedI found that I can load the view into the footer with this:
$view = views_get_current_view();
Now it's just a matter of pulling out the fields. The view is an enormous object and I can't really make heads or tails of it (is there some programmer trick to tracking down variable you want to use in a mess of an object like this?). As I'm looking through it, though, I'm thinking it might not be the best idea to load the entire view again once it's been loaded. So I guess the question remains - what is the best way to do this?
Comment #2
gthing CreditAttribution: gthing commentedThe best solution I've found is to load the view as above and use