0

I am building a booking system for a local theatre company. Each theatre event is its own node, and for the same show on different nights, the first night is created, and the node is cloned, with a different date and time for each show.

On the node event page I want to show a block view of other nodes with the same title, and different show times.

I have created a contextual filter by node ID, and excluded the current node from the view already, now I need to display all other nodes that have the same title.

I'm a bit stumped though, I can create a contextual filter by node title, but I cant figure out which options I need to select to achieve this.

Appreciate any help or advice.

  • 1
    You could add an entityreference field, so every node cloned could have a entityreference to the "original" node. – arrubiu Oct 29 '14 at 18:13
  • Yeah I've used the references module a fair bit. I'm trying to keep the required fields an event organiser has to fill out to a minimum though. I figured referencing nodes with the same titles would be the best option, but perhaps you are right. Id still like to hear suggestions of how to make this possible though. – Collins Oct 29 '14 at 18:16
0

I actually found the solution I was looking for here

I was close with what I was doing, I just needed to do the following...

  1. Add contextual filter by Content:Title
  2. Under "When the filter value is NOT available" Provide Default by Content ID from URL
  3. Under "When the filter value IS available" Specify validation Criteria as PHP Code
  4. Enter the following PHP code...
if (is_numeric($argument)) {
  $node = node_load($argument);
  $handler->argument = $node->title;
  return TRUE;
} else {
  return FALSE;
}
  1. Click Save.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.