Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.8
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2010 at 20:18 UTC
Updated:
28 Apr 2010 at 00:30 UTC
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
Comment #1
dawehnerSo:
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.
Comment #2
Drupoid commenteddereine, 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
Comment #3
Drupoid commentedComment #4
dawehnerDid you put something into the argument field, when you runned the preview?
Comment #5
Drupoid commentedThank-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?
Comment #6
merlinofchaos commentedSee the "views attach" module.
Comment #7
Drupoid commentedThank-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?