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.
I am calling an attribute {$page.node_id} which every node should have
ok, if it's not a page, what is it, because it looks like a page.Only page nodes have the page.node_id variable.
For the avoidance of doubt, this is a page node: https://xenforo.com/community/pages/example-page/
it does say div id content and class = assessments, but I don't see anything related to nodes around the body tags.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.
We use essential cookies to make this site work, and optional cookies to enhance your experience.