Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If I understand what you're saying, you're wanting to create a Views page that allows you to view nodes associated with a parent node (via a CCK Node Reference field)?</p> <p>Once you setup your View, you can just pass the nid (or title, or whatever field you choose as your argument), to the URL.</p> <p>So, assuming you have a Views page setup at: <a href="http://yourinstall.com/related-nodes" rel="nofollow noreferrer">http://yourinstall.com/related-nodes</a></p> <p>Just pass the argument in: <a href="http://yourinstall.com/related-nodes/5" rel="nofollow noreferrer">http://yourinstall.com/related-nodes/5</a></p> <p>The above (assuming your relationships / arguments are correct) will show all associated nodes with NID 5.</p> <p>Here's an <a href="http://i49.tinypic.com/rubb0i.png" rel="nofollow noreferrer">image of the views configuration</a> I used.</p> <p>You'll note the "path" setting on the views is "movies/%/reviews". I had two movies "Movie One" and "Movie Two", with a few reviews on each. You can then use <a href="http://yourinstall.com/movies/movie-one/reviews" rel="nofollow noreferrer">http://yourinstall.com/movies/movie-one/reviews</a>, etc... to see the titles of the reviews.</p> <p><strong>edit:</strong> Ok, so the clarification of the problem is, you have a Views block which displays a list of Reviews specific to a Movie. As well, you'd like the "more..." link to link to a Views page which display all the Reviews specific to that Movie.</p> <p>This is doable via the Views admin, but does involve a bit of PHP code.</p> <ol> <li>Your Views block can be setup similar to the above Views page.</li> <li>Override your Views block Arguments (Review Of) Node: Title, and under "Action to take if argument is not present", select "Provide default argument" -> "PHP Code".</li> <li><p>The code you use is:</p> <pre><code>if (arg(0) == 'node' &amp;&amp; is_numeric(arg(1) ) ) { $node = node_load(arg(1) ); return str_replace(' ', '-', strtolower($node-&gt;title) ); } </code></pre></li> </ol> <p>In essence, the Views block acts the same (expects a Movie node title), but will use the code above to try pull the title from the URL (note this works fine with path aliases). The Movie node title is placed into the more link as well (see the above image) in the format "movies/[movie-title]/reviews", which will link to the Views page as expected.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload