sitefaqlet
SiteDocClan
<!--
2003-05-22 [Mr. Muskrat] s/Perl Monks/PerlMonks/
2003-08-21 [jdporter] cleanup, formatting
2004-01-22 [jdporter] updated: all the good info is in 43037
-->
<p>
To link to a node by ID, use the syntax <tt><b>[id://</b>nnnnn<b>]</b></tt>.
</p><p>
For example,
if you write <code>[id://131]</code>,
you'll get [id://131], and
if you write <code>[id://131|PerlMonks]</code>,
you'll get [id://131|PerlMonks]. Both link to the same place, node 131.
</p>
<h3>Finding the ID number of a node</h3>
<p>
If someone created a link to a node using its ID number,
as described above, then the URL will contain the number,
and you can use that number yourself if you want to make
your own link to that node.
</p>
<p>
If, however, you only know the title of the node, then
finding its ID number is a little more involved. The easiest
way is to actually go to the node (follow a
link to it, or type the title in the <b>Search</b> box)
and get the ID of the node from its page.
The ID of each node can usually be found near the top,
just under the title. For example, on the page you are now
viewing, you should see <b><tt>#[17441]</tt></b> up above,
just below
<b>How do I link to a node on this site by number?</b>
</p>
<p>
If linking to nodes by ID is something you'll want to do a lot,
then you may find it convenient to have each node's ID displayed
in your browser's title bar. You can do this through a user setting.
To do this:<br/>
Edit your [href://?node_id=450961#Custom-Node-Title|Display Settings] and set the <b>Custom Node Title Definition</b>
to include <code>%N</code> (to show the node ID).
You'll probably want this to show the node's Title as well, so include <code>%T</code>
in the setting too.
</p>
<p>
To retrieve the ID of a node programmatically, you can use one of our
[id://72241|XML generators] to get the metadata of a node, including its ID and title.
For example, you can get the info of this page with the <br>URL
[href://?node_id=37150;xmlstyle=flat;nodes=17441], which returns XML like
<code>
<?xml version="1.0" encoding="ISO-8859-1"?>
<info site="http://perlmonks.org/" sitename="PerlMonks">Rendered by the Node query XML Generator
<node node_id="17441" author_user="17342" createtime="20000609213640" lastupdate="" nodetype="sitefaqlet" author_name="SiteDocClan">How do I link to a node on this site by number?</node>
</info>
</code>
<p>
For those who have enabled their [id://590089|Free Nodelet]:
You can add codes there which show you the current node's ID.
[id://590089].
</p>
<h4>See Also:</h4>
<p>
[id://43037]
</p>
<p>
Especially, read and heed these [href://?node_id=43037#tips|important shortcut usage tips]!
</p>
<hr/><i>Back to the [PerlMonks FAQ]</i>