james6848
james6848

Reputation: 1667

Drupal Views Attach - Attach View to View using fields

I'm using this excellent method to attach an image gallery to a node using 'Views Attach' and 'Node Reference URL' modules (amongst others): http://www.lullabot.com/articles/photo-galleries-views-attach .

It's working fine. What I'm trying to do now is to create a page of teaser items that will have an attached single image version of the gallery.

After creating a new Views attachment for the image I can do this using a new page View that uses Row style = Node, and this works (the image is displayed). However this doesn't give me the fine grain options that using Row style = fields allows.

So is it actually possible to use Row style = fields with Views AND have another View attached to it? I thought there might have been a nice 'Attached view' field to choose... :)

Edit: I guess I can use a themed version of the node teaser to remove some of the node elements I don't want to show up (tags etc.). Will try that...

Cheers, James

Upvotes: 1

Views: 1757

Answers (2)

Jorrit Schippers
Jorrit Schippers

Reputation: 1655

You can do what Hunter Frazier suggests, or you can add his PHP snippet as a PHP field to the view settings. In this way, you don't need to create a template file because the view output is considered a field of the primary view.

Upvotes: 1

Hunter Frazier
Hunter Frazier

Reputation: 11

Just build out the views using rows. Then you can override the view template for that particular view (ex: views-view--yourviewname--block-1.tpl.php).

Within that template you can embed any of your other views ex: <?php print views_embed_view('viewname','block_2')?>

Upvotes: 1

Related Questions