0

Possible Duplicate:
Get a node ID from the URL

I have two content types which one referenced to another by url widget, when i click on the link the node id passing with the url.
How can i get this nid from the url?
Is there some function for that? Thanks

marked as duplicate by kiamlaluno Jan 22 '13 at 16:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

If you are wanting to use the nid of the node reference field inside a node template, you could grab it as $node->FIELDNAME[0]['nid'] (D6 anyway, add an ['und'] or something similar in the mix for D7 :) Otherwise, a lot of other examples are given in the article @refineo references above.

Not the answer you're looking for? Browse other questions tagged or ask your own question.