Is there a definitive, universal way to do this? For example using an 'environment' variable that comes with Drupal.behaviours?
Have done some research and there doesn't seem to be a common answer.
Is there a definitive, universal way to do this? For example using an 'environment' variable that comes with Drupal.behaviours? Have done some research and there doesn't seem to be a common answer. |
|||
add comment (requires an account with 50 reputation) |
As mentioned above, Drupal core has no use for the node ID on the client side so it doesn't pass it through. if you want access to it you'll need to add it manually using
Then on the client side you'll have access to it through
|
|||||||||||||||
|
The default
This will stick on classes to the |
|||
|
drupal_add_js()
; the nid isn't ever used on the client-side by core so there's no need for it to be added as a setting usually – Clive♦ Jul 8 at 12:32