The view is set to fields (informatted) and I try to get the field variables using:

<?php
  print '<pre>' . htmlentities(print_r($rows, 1)) . '</pre>';
  // If you have devel.module installed, comment the line above and uncomment the line below
  // dsm(array_keys($fields));
?>

Devel is installed hence the code ought to be

<?php
  print //'<pre>' . htmlentities(print_r($rows, 1)) . '</pre>';
  // If you have devel.module installed, comment the line above and uncomment the line below
   dsm(array_keys($fields));
?>

Issue also raised here, but moved to the views module (for that makes more sense)
Yet nothing is printed and no field variables are seen.

.tpl.php shown below:

<div class="<?php print $classes; ?>">



<pre><?php print $row->{$field->field_alias}; ?></pre>

<?php
  print // '<pre>' . htmlentities(print_r($rows, 1)) . '</pre>';
  // If you have devel.module installed, comment the line above and uncomment the line below
     dsm(array_keys($fields));
   
?>


</div> <?php /* class view */ ?>

Comments

dakke’s picture

Weirdly enough I get the variables using
dsm(array_keys(get_defined_vars()));

Yet the fields do not show... anyone?

dakke’s picture

Appears to have something to do with the dev module. Posted an issue here.

I get the error

warning: array_keys() [function.array-keys]: The first argument should be an array in /xxx/local sites/website/sites/all/themes/zen/templates/views-view--Nodes--page-3.tpl.php on line 2.

The entire tpl.php consists of 3 lines, namely:

<?php 
  dsm(array_keys($fields));

?>
kars-t’s picture

Status: Active » Closed (won't fix)

Dear fellow Drupal enthusiasts,

This issue is now lasting for a very long time in the issue queue and was unfortunately never solved. As Drupal is a open source project, everyone is helping on a voluntary basis. That this was not solved is nothing personal and means no harm. But perhaps no one had time to deal with this issue, maybe it is too complex, or the problem was not described comprehensibly.

But this issue is not the only one. There are thousands of issues on Drupal.org that have never been worked on or could not be processed. This means that we are building a wave that is unmanageable and it is a problem for the Drupal project as a whole. Please help us keep the issue queue smaller and more manageable.

Please read again, "Making an issue report" and see if you can improve the issue. Test the problem with the current Core and modules. Maybe the problem doesn't exist anymore, is a duplicate or has even been solved within this issue but never closed.

Help can also be found for it on IRC and in the user groups.

In order to close this issue, I have set this issue to "Closed (won't fix)".

If there is new information, please re-open the issue by changing the status to active.

--
This issue was edited with the help of Issue Helper