I'm using these snippets from this handbook http://drupal.org/node/45479

I can customize everything in my node-flexinode-11.tpl.php file (11 is the content type I'm working with) However when I try to display and image using codes from the above handbook it doesn't work. Nothing is displaying on the screen in the form of an error and everything else (the other two node fields i'm calling on) are getting displayed. I checked the Apache log files and it's reporting thos error: [Thu Apr 27 23:27:36 2006] [error] [client 127.0.0.1] Filename is not valid: c:/instantrails/www/http:

So the script isn't working correctly on my setup - is this a bug or something wrong with my config?

Comments

danethomas’s picture

Always the way after u play with things for ages and then as soon as you ask for some help you get it working.

Anyway it still could be a bug.

I found a slightly different code to use:

 <?php if ($node->flexinode_48) : ?>
  <img src="/subdir/<?php print($node->flexinode_48->filepath) ?>"
  <?php endif; ?>	  

Anyway once I put the subdirectory in there (cause I'm using drupal in a subdir) the images started showing up - not sure if the subdir is something to do why the code in the handbook wasn't working, but this above code seems to be fine for me.

samc’s picture

Hmmm... Fishy.

You might want to check your $base_url in settings.php, and the RewriteBase setting in your .htaccess file.

thomjjames’s picture

i had the same problem.
try this it fixed it for me.

<img src="<?php print base_path() . $node->flexinode_48->filepath; ?>" />

cheers
Tom