I've successfully embedded a view in a node using php and views_embed_view. However, if I promote the node to the front page, the embedded view doesn't appear in the node teaser on the front page. I'd like to know if it is possible to display an embedded view in a node teaser and if so, what I should do to get this to work.

Thanks!

Comments

dawehner’s picture

Status: Active » Fixed

Instead of using php you should use http://drupal.org/project/views_attach

Alternative this is a general drupal question and not related to views at all

solidarity’s picture

Thanks, dereine. I have some experience with views_attach and I don't think it provides the solution I'm looking for. I need to be able to embed a view anywhere in the node body content, which is why I went with php (I also tried insert_view and I'm having the same issue).

A bit more detail: I'm uploading photos to the node via cck and imagefield. The view simply outputs the images attached to the node using an argument. Then, of course, I embed the view in the node body. Given that I'm looking to flexibly embed the view in any part of the node body and still have it displayed in a teaser, do you think views_attach could be a good option? Or should I leave views as it is and start looking into php output in teaser lists?

dawehner’s picture

The view is not shown there because drupal truncates the teaser. This is not a views problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.