User login

Show nodes that reference a node, in a block

News content type has a nodereference that references Industries, Services, Products, and Testimonials.

From the Product, Testimonials, Services, and Industries nodes we should be able to see what News nodes referenced them.

That is, when on the product Widget, we want it to see news items that reference Widget.

Here is the answer to showing in a block the nodes that nodereference the current node

http://drupal.org/node/161867#comment-256061

arg(0) would be node, and arg(1) is the node ID.

From the below issues:

Note that relationships in Views 2 make this trivial as long as you're using a 'Field' row-style View :
Add a 'Node:id' argument, add a relationship on the noderef field, and add the node title (for instance) through the relationship.

You get the titles of the nodes referenced by the nid you provide as an argument.

list nodes referenced by a noderef field
Works fine using a Node:nid argument + noderef relationships

http://drupal.org/node/241078
"Giving it a quick try, it seems to work fine except for nodes for which the noderef field is empty (also generates a broken link in the summary). Thus keeping as 'code needs work'"

Let row plugins follow relationship
http://drupal.org/node/327366

It's like they were solving the problem while we typed.

Reference

http://amariotti.com/blog/reverse-nodereference-block

See Also

http://drupal.org/project/views_attach

Resolution

Searched words: 
drupal views reduce duplicates reverse nodereference block Views 2 plugin all nodes that reference a node

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.