Display a video next to a quiz On my site I have a series of quizzes.

Each quiz has it's own video (an embedded Vimeo video).

The videos are on a custom content type called 'Video'.

I want to display the video next to the questions throughout the quiz.

I used the Entity Reference module and on the quiz node I referenced the video node.

I used page manager to display the video node next to the quiz. This was ok but when I started the quiz, the video disappeared.

I thought I could create a block with mini panels or with views and display the referenced node but I can't seem to get that to work.

Does anyone know how to display a node on a block that is being referenced by the current node? Or is there a way I can use page manager to display the video when the quiz is in progress?

I am using Drupal 7, and the Quiz module 7.4.
I worked out a way to do it.

Create a block with some custom PHP.

&lt;?php

//Find current nid
if (arg(0) == 'node' &amp;&amp; is_numeric(arg(1))) $nodeid = arg(1);

//Load that node
$node = node_load($nodeid);

//Get referenced entity if it exists
if (isset($node-&gt;field_videolink['und'][0]['target_id'])) {
    $refnid = $node-&gt;field_videolink['und'][0]['target_id'];

    //Now load that node
    $node2 = node_load($refnid);

    //Display the body 
    print($node2-&gt;body['und'][0]['value']);
};

?&gt;


The entity reference field is called 'videolink'. You should enable the block only for the quiz content type otherwise you'll get an error on the home page.

Apologies if the PHP is a little shoddy. I'm not an expert by any means.