Drupal 6 + Views 2 : Created similar node based on Node Title

By BXTra |

I need my node to show related nodes below it. Since I know that my Node Title will be very similar in the name but different Season or Number like example below.

Node 1 - Final Destination DVD
Node 2 - Final Destination DVD 2
Node 3 - Final Destination DVD 3
Node 4 - Lost Season 1
Node 5 - Lost Season 2

When I open Node 1, links to Node 2 and Node 3 should be there below the content.

When I open Node 5, links to Node 4 should be there below the content.

I can do that by set Views as below:

1. Create Views name "Related Title"

2. Add an argument type "Node: Nid"

3. Choose "Provide default argument" under "Action to take if argument is not present:"

4. Select "PHP Code" under "Default argument type:"

5. Use the code Below :

 0){ $nids .= ',';}
$nids .= $node->nid;
return $nids;

6. Also check on "Allow multiple terms per argument."

7. Save it.

8. Set up the "Fields" that you want to display.

9. Add "Block" Display.

10. Under "Block" -> "Admin". Set "Block: Block admin description" to "Related Title"

11. Put that Block in to where you want it to display.


Add new comment

  • No HTML tags allowed.
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.