Forums / Developer / Getting the node_id asigned to the node once created!

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Getting the node_id asigned to the node once created!

Author Message

Jorge estévez

Monday 18 July 2005 12:50:04 am

If I asign a new location for the contents of a node, How can I "get" the original node_ID for that node?

I mean, the node has a node_id once created but when located on another place it will also have another node_id (not beeing the original node_id)

I would like to ther the node_id once it was created!

thanks!

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

David Eriksson

Monday 18 July 2005 2:34:42 am

If you kept the original location as main, you can use $node.main_node_id.

/David

Jorge estévez

Monday 18 July 2005 2:48:53 am

Hi David,

What do you mean by "If you kept the original location as main"...

thanks!

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

David Eriksson

Monday 18 July 2005 3:47:38 am

Out of all the locations for an object, there is one that is designated "Main". If you add new locations using PHP code, you can choose if the new location should be made Main or not. If you just add locations through the admin interface, the original location should stay Main unless you decide to change it, after the new location has been added.

/David