XF 1.5 How do I find out node ID?

Brogan

XenForo moderator
Staff member
#2
{$page.node_id} will return the ID of the page node.

If you mean you just want to find out what it is, click on the page node in the ACP - the ID will be in the URL, after the period.
 

Brogan

XenForo moderator
Staff member
#9
The guide explains in detail how to check whether a variable is available in a template and what steps can be taken to make it available if it isn't.
 

Brogan

XenForo moderator
Staff member
#13
I don't know what the 'something' is so I can't offer any more advice.

Templates have names, nodes have IDs.

Your initial post and subsequent posts in this thread don't really explain what it is you are doing, which node or template you are trying to do it on, or any other pertinent details.
 
#14
It was not developed by me. It's just a template with a lot of code, but I can't locate any "page" associated with it? There aren't a lot of variations in this is there, so how might I retrieve the ID?
 

Mike

XenForo developer
Staff member
#15
If it's a page node, it would appear in the node list in the control panel and the template would have a very particular name (which would actually have the node ID in it). Given that it sounds like neither of those are true, it seems likely that it's something other than a page node, thus we wouldn't really we able to tell you any specifics about what may be available to it. The person who developed it would be best positioned to help.
 

Mike

XenForo developer
Staff member
#17
If it's not a page node, it'd presumably be something custom.

If you give us the URL to the page in question (and the name of the template you're trying to edit), it might help give us more info.
 

Lawrence

Well-known member
#18
It could be a page node that uses a php callback. To find out, inspect the source. This line will contain the template name in the class, for example for my page node: <div id="content" class="rpmodule_temple">, the template name for that page is rpmodule_temple.

If you scroll further up, you will see the <body> tag. Within the body tag the class is set to the current node id, and it's parents. In my example:<body class="node21 node14 node16"> For my example the node id for my temple page is 21.

May help, may not.
 
#20
It could be a page node that uses a php callback. To find out, inspect the source. This line will contain the template name in the class, for example for my page node: <div id="content" class="rpmodule_temple">, the template name for that page is rpmodule_temple.

If you scroll further up, you will see the <body> tag. Within the body tag the class is set to the current node id, and it's parents. In my example:<body class="node21 node14 node16"> For my example the node id for my temple page is 21.

May help, may not.
it does say div id content and class = assessments, but I don't see anything related to nodes around the body tags.
 
Top