I have added a Lightbox2 link to the video node body manually

I would like to add a field for the video content ty[pe that will automate the Lightbox2 link

something like

<?php echo '<a rel="lightvideo" href="' . $node->vidfile . ',flv">Full screen</a>'; ?>

I have tried to test this using devel execute php code but I don't get any value (or error either) for $node->vidfile

checking Dev Render for the node I see:

vidfile
http://spvid.decibelplaces.com/files/videos/DrivetoBasket4.wmv

Comments

decibel.places’s picture

Status: Active » Closed (fixed)

figured it out - put this code in page.tpl.php of theme

	/* LIGHTBOX LINK */
	$types = array('page' => 1);
	// Which nodes (by nid)
	$nodes = array(1, 2);
	if (arg(0) == 'node' && is_numeric(arg(1))) {
	  $nid = arg(1);
	  $node = node_load(array('nid' => $nid));
	  $type = $node->type;
	}
	if ($type == "video") print '<div id="lightboxlink"><a rel="lightvideo[width:800px; height:600px;]" href="' . $node->vidfile . '">View Video Full Screen</a></div>'; 
	/* END LIGHTBOX LINK */
decibel.places’s picture

The .flv video file did not work reliably in the lightbox, so I changed it to display the original video file (in this case, a .wmv file)

Also removed a couple of unnecessary lines:

/* LIGHTBOX LINK */
if (arg(0) == 'node' && is_numeric(arg(1))) {
	$nid = arg(1);
	$node = node_load(array('nid' => $nid));
	$type = $node->type;
}
$vurl = $node->vidfile;
$flv = strpos($vurl,".flv");
if ($flv) $vurl = substr($vurl, 0, $flv);
if ($type == "video") print '<div id="lightboxlink"><a rel="lightvideo[width:800px; height:600px;]" href="' . $vurl . '">View Video Full Screen</a></div>'; 
/* END LIGHTBOX LINK */