I have created a block to display flash content. All it needs a a variable to be assigned dynamically from the content to flashVar. I created a field called myfile path in the custom content type. Which is just a text pointing to the path of file. I also created a block and below is the code inside the block.
<?php
$myFilePath = field_get_items('node', $node, 'field_myfilepath');
?>
<script src="/player/swfobject.js"></script>
<script>
function swfDimensions(width,height)
{
document.getElementById('altContent').style.width=width+'px';
document.getElementById("altContent").style.height=height+'px';
}
var flashvars = {
filepath:"<?php echo $myFilePath;?>" // this where I use the filed value which my flash app uses internally
};
var params = {
menu: "false",
scale: "noScale",
allowFullscreen: "true",
allowScriptAccess: "always",
bgcolor: "",
wmode: "direct" // can cause issues with FP settings & webcam
};
var attributes = {
id:"altContent"
};
swfobject.embedSWF(
"/player/contentviewer.swf",
"altContent", "640px", "390px", "11.3.0",
"/player/expressInstall.swf",
flashvars, params, attributes);
</script>
<h4>Floorplan Basic</h1>
<div id="altContent">
To view this content you need Adobe flash player (v11+) plug-in installed on your browser
<p><a href="http://www.adobe.com/go/getflashplayer">Get Adobe Flash player</a></p>
</div>
I am getting this error
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7663 of C:\...\www\includes\common.inc).
Can any on tell me how to get the value of the field in this block? I am totally new to drupal.