I'm customizing the amazon-item.tpl.php and I need to access the node's nid. I want to create a special internal Drupal link, like /node/x/special where x = $node->nid.

Is there a way to access $node within amazone-item.tpl.php?

Comments

fragtom’s picture

Assigned: Unassigned » fragtom

Hello morningtime,

I think, you're able to access to the node-id via standard drupal way, with the arg(1) function. Please see at http://drupal.org/node/945934, there I've described that.

best, tom

rfay’s picture

People ask for this so often, it would probably be good to add the node to $variables in amazon_preprocess_amazon_item().

Anonymous’s picture

@fragtom, indeed your solution will work when you are on a node page. But it wont work on overviews/lists/taxonomy pages.

But thanks for the tip, I will use it on node pages.

willvincent’s picture

Assigned: fragtom » Unassigned