I am trying to display the node id in the body section of my node. I change the input format to PHP code and then insert the following code but it doesn't seem to work.

print $node->nid;

Any help would be much appreciated.

Thank you!

Comments

erdemkose’s picture

You can use

 print arg(1);

for a node of ?q=node/383
arg(0) = 'node'
arg(1) = '383'

+Signature------------------------+
|____________erdemkose____________|
+---------------------------------+
slayerment’s picture

Perfect. Thank you very much :)

batigolix’s picture

this displays a part of the url ... not the id of the node