I've just discovered this module and it looks really useful. I wish I'd discovered it a few weeks ago - it'd saved me a great deal of work...

Just one thing - when I create a new field or teaser template, only the first node in the view shows up.

When I change it back to the standard list view in the 'View Type' drop-down, the rest of the nodes re-appear.

Is there something I've missed?

The code in my field template box is as follows:

<div class="3column">
<?php print $nodes[0]->node_title['value']['view'] ?>
<?php print $nodes[0]->node_data_field_artist_images_field_artist_images_fid['value']['view'] ?>
</div>

Comments

Anonymous’s picture

I got similar issue.

awebb’s picture

Are you looping through them?

This is most likely a problem where the view is always accessing the zero'th element.

Try this.

<div class="3column">
<?php
foreach ($nodes as $node) {
  print $node->node_title['value']['view'];
  print $node->node_data_field_artist_images_field_artist_images_fid['value']['view'];
}
?>
</div>
derekwebb1’s picture

Status: Active » Closed (fixed)

Alternatively you can use an index too.

For instance...

$index = 0;
while($index < 10) {
  print $nodes[$index]->title (or whatever);
  $index++;
}

The point is, whatever you do, DON'T use a constant number as an index! This is an array of items. Remember... An array...

fluxline’s picture

will be very helpful module, but for right now i have the same problem. simple view with some nodes field template setup and activated. template code:

foreach ($nodes as $node) {
  print $node->node_title['value']['view'];
}

only 1 template on that view, cleared views cache, anything else to try?

EDIT: this comment should have been placed in issue 287342. questioned asked there.