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.

$myFilePath = field_get_items('node', $node, 'field_myfilepath');

<script src="/player/swfobject.js"></script>
        function swfDimensions(width,height)
        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 = {
            "altContent", "640px", "390px", "11.3.0",
            flashvars, params, attributes);
        <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>

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.

2 Answers 2


I guess $node is not defined. You should know when a node page is shown. Then get the node id using arg(1). Load the node object and then use.


Try variable_set() and variable_get()

Set the variable like that:

// I have assumed the variable name to be "the_name_of_the_variable"
variable_set("the_name_of_the_variable", "the value of the variable");

And then retrieve the value like that:

$my_variable = variable_get("the_name_of_the_variable", "a default value in case the variable has never been set before");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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