Drupal 7 Views - How to access the unformatted variable $ row in a user template?

I just installed the Views module for Drupal 7 and will try to figure out how to set it up.

So far I have been doing the following.

  • Created a content type of the specified views and called it a “video test”.
  • Created a custom theme as "view-view-list - videotest.tpl.php"
  • The page works without problems.

Here is the code for the custom template I used (this is the default template from Views):

<?php print $wrapper_prefix; ?>
  <?php if (!empty($title)) : ?>
    <h3><?php print $title; ?></h3>
  <?php endif; ?>
  <?php print $list_type_prefix; ?>
    <?php foreach ($rows as $id => $row): ?>
      <li class="<?php print $classes_array[$id]; ?>"><?php print $row; ?></li>
    <?php endforeach; ?>
  <?php print $list_type_suffix; ?>
<?php print $wrapper_suffix; ?>

How to prevent views for formatting $ row for me? I like to format all values ​​in node myself using foreach.

"" , .

+5
3

, "", "" "".

"Row". :

print $fields['you_field_value']->raw;

'you_field_value' .

+3

:

print $fields['field_pretitle_front']->content;
+2
print $fields['your_field_value']->raw;

didn't work for me, however in my case it had the following.

$row->field_YOUR_FIELD[0]['rendered']['#markup'];
0
source

All Articles