Community Documentation

Node Templates for Flexinode Content Types

Last updated August 26, 2009. Created by Code Rader on September 19, 2005.
Edited by ronald_istos, Jeff Burnz, sepeck. Log in to edit this page.

From the comment by jmengle at http://drupal.org/node/17565#comment-47183

If you are using this feature with a node type created by Flexinode, the name you give the node type (and therefore the name that is displayed) is not the name of the node type that the system uses. The node types created by Flexinode are actually named "flexinode-1", "flexinode-2", etc. One way to find this name is to look at the database table "node" in the name column.

For example, if you used Flexinode to create a node type called "info", then if you looked at the database, you would instead see a node named "flexinode-1". So, the template file you would create for "info" would need to be named "node-flexinode-1.tpl.php".

You can also find the number of the Flexinode by going to admin>>content>>content types and click on the choosen type. The number will be in the url (i.e. node/types/edit_type/1 would be flexinode-1).

In your node template (ie node-flexinode-1.tpl.php) you will reference the different fields of your flexinode with

<?php print $node->flexinode_1 ?>

You can then find the different fields in a similar way from the admin>>content>>content types page, by clicking on edit for the chosen field and looking at the corresponding url (i.e. node/type/edit_field/1 would be $node->flexinode_1).

This works well for fields of text area, text field, and date/time. For image you would use
<img src="/<?php print $node->flexinode_1->filepath ?>" />.

If the print call results in "Object" then you need to get into the code some. Substitute the print command with

<?php print serialize($node->flexinode_1)?>

It will look strange, but if you look it is a series of variables and their content. Find the one that meets your needs. If you figure out how a particular field type works, you might post the code here.