I have a content type called "Article" that contains several node reference fields that each point to an "Image" content type that contains my image with the image referenced by a single CCK file type field (each image content type contains only one image).

I want to display the images that my "Article" content type references (using the node reference fields) inside a block whenever my "Article" node is being displayed. I would like to display the teaser for the Image content type inside the block using Views Slideshow.

When I define my view for the Views Slideshow, how should I setup:

Fields?
Filters?
Any other special setup for the view?

Thanks in advance for any help you can provide me.

Comments

dawehner’s picture

Component: User interface » Documentation
Category: task » support
Status: Active » Fixed

So:

First you need to load the current nid via an argument.

Therefore add a node: nid argument and select "provide default argument", and there node: id from URL

Then you want to "load" the referenzed node. Therefore add a relationship, with the referencefield.

So with this you can access filters/fields of the "loaded" node.

Then add a field: content: yourimagefield and select the relationship at the top.

Thats it.

Drupoid’s picture

dereine, thank-you for helping me out. Here's what I did. I get "No query run" when I preview and nothing happens when I display my "Article" node which has two node references:

Arguments
Groups All
Add Node:Nid
Provide default argument
NodeID from URL

Relationships
Groups All
Add Content: Image Reference (this in the node reference in the "Articles" node)

Fields
Group All
Add Content: Image (this is the file field in the "Image" node)
Relationship: Image Reference

Drupoid’s picture

Status: Fixed » Active
dawehner’s picture

Did you put something into the argument field, when you runned the preview?

Drupoid’s picture

Thank-you! I used MyPHPAdmin to get the Nid for my node. I then entered that into the argument field and it worked!

Now I need to know how to position blocks anywhere on the page. For example, not just in a right or left sidebar, but between two CCK fields. Is that a Views question?

merlinofchaos’s picture

Status: Active » Fixed

See the "views attach" module.

Drupoid’s picture

Thank-you! Now I understand how you can use Views to create some nice database-powered components (like a slide show driven from CCK node reference fields) that you can place on your page with a block or page reference.

But what if I want to arbitrarily position CCK fields and blocks on the page with a drag-and-drop interface and then save that configuration? Do you use Views to do that, or is there another module?

Status: Fixed » Closed (fixed)

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