I have a custom content type called "project" that sets up a basic project profile and another called "project popup" that creates a thumbnail from the node's teaser template and pops up a javascript window with the same node's full content template in the popup window.

I made a view that shows a series of "project popup"s and figured out how to embed it in the "project" template. So now I have the basics at the top of the page and a bunch of thumbnails on the same page, but the problem is that I can't figure out ho to show just the thumbnails for the particular project.

On the project popup content type, I added a Node Reference dropdown called project so I can attach each thumbnail to a project as I make them.

The only thing I can't get past is how to filter only thumbnails with Node References to the current page's node ID. It offers me a node reference option in the view filters, but only allows me to define a specific project to filter the view by.

Do I need to write a custom filter or is there some sort of module that would fix this for me? Or just a way I'm not seeing how to do it with what I already have installed?

Comments

rachelr’s picture

Ok, I searched for 2 hours on this issue before posting and then found a solution 20 minutes after posting.

it's all here: http://drupal.org/node/86410

rup3rt’s picture

Hope this is related >>>>>

I use viewfield (just updated in 4.7 & 5.x) to embed a view of only the connected items within a holding/master node. It is a list of restaurations (the items) undertaken a historical building (the node).

In the CCK form for the holding/master node, each record has a node reference set to the appropriate view (made up from a different cck content type) with %nid as the argument

In the view, I have Node Reference in the argument field then $args[0] = arg(1); as the argument
see http://drupal.org/node/70145

There is some other info here that could also be relevant to what you have: http://drupal.org/node/110845

I haven't successfully themed the embedded view (any tips/shortcuts welcome) but it works well and only shows up records related to the holding/master node. I just successfully connected a bibliography records view and a view old names for the building. In 4.6 we hacked taxonomy and book.module to do this, I think subform might also offer an option. There are more forms the viewfield way but it is easy to maintain and scale.

R3

rachelr’s picture

Thanks. I wasn't aware of viewfield. I'll definitely look into it. It'll probably be easier to both do and remember than manually pasting the views into template files.
I've found that using Contemplate has really sped up my template editing. If you're not using it, give it a try.