XF 1.5 How do I find out node ID?

Stockwalker

Active member
I have a template that is associated with a page. However, it is not in the node list. How do I find out the node ID dynamically?
 
{$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.
 
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.
 
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.
 
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?
 
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.
 
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.
 
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 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 Bottom