display a node id within a specific content type I'm looking for a way to display the node id somewhere on all displayed instances of a given content type.  It doesn't need to happen in any particular way, but it would sure help my users to be able to see the node id, as we use it to track physical objects.

I would imagine that there are a couple of ways to do this, so if someone could outline the options that would also help.

I've tried something like

&lt;?php
$node_id = arg(1);
echo($node_id);
?&gt;


To no avail, as I can only put this in each individual node instead of all nodes for a given content type.
If you're trying to do this for a certain content type, and have a custom theme you're using with your site, I'd suggest modifying the template file for that content type to print out the node id somewhere below or above the content. 

However, if you're not very good with theming a really creative way to do it is by creating a view block and enabling it for that content type.  Then the node id can be displayed on the side of the content.  It can be nothing more than a line... doesn't have to be obtrusive.

To do the above:


Create a new view and call it something like 'Node id display' (uncheck the page version of the view and only create a block version).  Restrict it to the content type you want here, and make sure it's displaying fields, rather than titles, summaries or whatever is the default
Under the view's 'Fields' section, remove all fields that appear by default and only dislay the 'Content: Nid' field.  You can change the label to be something like "Node id" instead of 'Nid' if you prefer.
Under the 'Advanced' section of the view, add a contextual filter of 'Content: Nid', and in the configurations, select for it to 'Provide a default value' if a filter is not present.  From the drop-down, select 'Content ID from URL'
Either through a context or from the block's admin page, enable the new block for your specific content type... place the block on a sidebar, above the content, below the content... anywhere you want. 


:-)

Hope this helps!