User account menu

  • Log in
BXTra.net

Breadcrumb

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

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

By BXTra | 12:49 AM PDT, Thu October 28, 2010
Drupal
Views

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;
$i++;
}
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.

http://drupal.org/node/302498#comment-1126227

About text formats
  • No HTML tags allowed.
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.

palovnik123

14 years 3 months ago

Permalink

palovnik123@gmail.com

See more
  • Reply
  • Add new comment

  • Will the router get the Openvpn as a client option?
    6 years ago
  • cancellation
    6 years 1 month ago
  • Router ASUS RT-N12 D1 tomatoes passwort falsch
    7 years 8 months ago
  • WPS button = 30/30/30 hard reset button
    7 years 9 months ago
  • Save my day!
    8 years 3 months ago
  • How to
    8 years 6 months ago
  • Can i still access my modem (the one with the ISP provided)?
    8 years 6 months ago
  • A saving step!
    8 years 10 months ago
  • Problem with Asus n12e-c1
    8 years 11 months ago
  • don't use Hostgator
    9 years 2 months ago

© 2007 - 2023 BXTra.net. All Rights Reserved. 
Certain other content, photos and artwork displayed on BXTra.net are protected by copyright and are the property of their respective owners.

Privacy Policy