Hi!

I have a situation where I use flexinodes to present specific page types having a bit more info than just title and content. Anyways, with each full view of the node, I'd like to show some lists of additional nodes, pulling it using Drupal's core functions for querying database and outputting node teasers (the theme() function) -- for instance, listing nodes belonging to certain terms that are in conjunction with the terms of the flexinode. Since the code is the same for all nodes of this flexinode type, I thought the easiest way was to put the code in node-flexinode-2.tpl.php, but it doesn't work.

Can anyone tell me if core API (db_query and theme) is available within this .tpl.php file, and if not, which core scripts should I include or require_once() in order to get them -- and if this is adviseable to do at all?

Thanks in advance!

Comments

CoR-1’s picture

As I'm not that much of a PHP programmer and I don't know if this is because of the way these files are evaluated from the core, but the problem was in declaring a function in .tpl.php. As soon as I put the code outside of a function, it worked well.