Converting entityId to nodeId

hyperbole

Joined: 2007-07-11
Posts: 6
Posted: Thu, 2007-09-20 20:04

I'm in the process of creating a module for a client who is using Gallery2 embedded in Drupal. We want to add a button to the image page that allows the viewer to add an item to a shopping cart. The cart software expects to receive a Drupal node ID to identify the product to be added to the cart. All I have to identify the photo is a Gallery Entity ID. How do I convert an Entity ID to a node ID?

Thanks.

 
profix898

Joined: 2005-11-08
Posts: 135
Posted: Mon, 2007-09-24 09:51
Quote:
All I have to identify the photo is a Gallery Entity ID. How do I convert an Entity ID to a node ID?

I think you misunderstood how gallery module works. There are no Drupal node ids associated with the G2 album/photo entities! G2 and Drupal are operating independently except for G2 output being wrapped in a Drupal page. But there are no entity<>node relations.
Actually I'm currently working on the gallery_content module (as part of the gallery package), which tries to solve exactly this problem. The module 'imports' G2 items into Drupal nodes (without duplicating the images). See http://drupal.org/node/138400 for more details.

 
hyperbole

Joined: 2007-07-11
Posts: 6
Posted: Tue, 2007-09-25 17:59

profix898:

Thanks for your response. I looked at the module you're working on and it looks as if it might be just what we need. I'll have to check it out with my client and see what he thinks.

Thanks.