Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Getting the node number of a space-filled node ID

by stevieb (Canon)
on Oct 02, 2016 at 23:29 UTC ( [id://1173130]=monkdiscuss: print w/replies, xml ) Need Help??

This probably doesn't come as a surprise to many, but I thought I'd throw it out there for those who, like me, haven't realized it before.

We all know that we can link to a node by using its ID: [id://789891|stevieb's home node], but some node IDs have spaces: ChatterBox FAQ. These ones break horribly when trying to use them in [id://ChatterBox FAQ] context.

After years and years of being here, I realized that at the top of every.single.page, the node ID is readily available in the on Nov 07, 2000 at 16:08 EST ( #236794=sitefaqlet: print w/replies, xml ) line, right under the by: $person line. Grab the number to the right of the #, and drop it into the id:// tag: [id://236794], and you're good to go.

I'll bet there are other ways to glean this information, and why I didn't notice it earlier is beyond me. Either way, I thought I'd throw this out there :)

Replies are listed 'Best First'.
Re: Getting the node number of a space-filled node ID
by jdporter (Paladin) on Oct 03, 2016 at 16:39 UTC

    Just to clarify your terms a bit... The numeric node number (e.g. 236794) is the node ID, whereas the texty string (like Chatterbox FAQ) is the node title.

    Normally, you'd use two different CGI params for these: node_id in the first case, node in the second case. *

    To set those up in shortcuts, you'd do [id://236794] in the first case, [Chatterbox FAQ] in the second. **

    (* It's possible to pass a node ID to the node= parameter; the engine is smart enough to figure out that you were probably passing a node ID rather than a title.)

    (** When the engine gets a URL with a node= param (like node=Chatterbox FAQ), it's not so much linking directly to "the" node with that title; it's really doing a search for any & all nodes with that title. Only when there is exactly one node with that title does it take you directly to that page.)

    I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.
Re: Getting the node number of a space-filled node ID
by beech (Parson) on Oct 03, 2016 at 00:35 UTC

    Hi

    There are nodelets that have info :) see Nodelet Settings

    Node Status node history Node Type: monkdiscuss [id://1173130] help

    Approval Nodelet node history FrontPage Consider node: Node Type: monkdiscuss [id://1173130] Approved by beech help ntc

    There is also Show an id:// shortcut on replies? checkbox in Display Settings

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://1173130]
Approved by beech
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (8)
As of 2024-03-28 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found