[support] How to show various fields of the referenced node in views
Shai Gluskin
shai at content2zero.com
Fri Aug 1 18:21:08 UTC 2008
geniekids,
In D6 I think this is pretty straightforward using, what I think is called,
a "relationship" in Views. I'm still using 5 though, and can't speak first
hand to that.
In D5 you can do something I think this is pretty easy to do with PHP at the
theming layer. I've watched someone do it, but haven't done it myself. It's
also possible to do something like this. It's a bit complicated, I'm just
learning -- using Panels 2. Also, I know how to do this to display one
record at time (e.g. if you display the Book node page, the relevant info
from the bookreading_schedule will also show up. If more than one reading is
associated to the book -- then they will all show up. But it is one book at
a time.)
This is rough, but it may get you started.
1. Make a View for the book-scheduling node type. For display, choose a page
and Full node, teaser, list, doesn't matter, whatever info you want to show
from the book-scheduling node type. Filter on "node-type is one of
booksheduling'. Add an argument which is the node-reference.
2. Make a panel page. Give it a title, makde the URL: node/%. THEN, Go to
the "context" tab and add "Node ID" as an argument. Make sure to select the
right box from the "node type" list -- in this case the book node type.
3. After you save that go to panes -> views pages. There you import the view
you created in step one.
4. Now you go to the "content" tab of your panel. Click on one of the "+"
symbols. From there you add "Node ID Content". Save. Go back to Content,
click "+" and click on the Views pane that you imported.
Remember this is panels 2. Get the most recent version. Remember in panels
that you always need to keep saving every step or you lose it. Anything in
yellow needs to be saved.
I'm sure I'm forgetting something.
Because this only does one record at a time, you might be looking for a
different solution. Hope this at least adds to the conversation.
Report back,
Shai
On Thu, Jul 31, 2008 at 11:51 PM, geniekids <ratadi2 at gmail.com> wrote:
>
> I think my need is simple but after a whole lot of search i am unable to
> get
> it working - hence this post
>
> i have one cck with book name, book author, Book number, book publisher,
> book references etc ( and some more fields);
>
> Next i have another cck called bookreading_schedule with two fields - one
> date and another (a node reference) to the above book name.
>
> Now I want a view (based on node: 'bookreading_schedule') which lists the
> date and with the date lists its referred book name AND ALSO book author
> and
> book number (these four fields)
> Through node reference i got the book name to show up in the view next to
> the relevant date.
> but how do i get the selected fields (about the book) to show up.
>
> So, How do i get only the selected fields from the referred node to show up
> in views in tabular form
> thanks
> ratnesh
> --
> View this message in context:
> http://www.nabble.com/How-to-show-various-fields-of-the-referenced-node-in-views-tp18760939p18760939.html
> Sent from the Drupal - Support mailing list archive at Nabble.com.
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20080801/5e56481c/attachment-0001.htm
More information about the support
mailing list