I have a gallery node type and image node type implemented using the method described by lullabot. I have several galleries and lots of image nodes and want to use NG3... is there some sort of migration or can i choose pre existing node types upon installation/set up?
Thanks!

Comments

jjjames’s picture

I tried it and I can map existing node types, but seems that old images don't get included into the galleries? If I add a new image, it works. Any ideas?
thanks

scroogie’s picture

So does the lullabot method create a node for every image, or does it attach multiple images to the same node?

To bulk assign images to galleries you can use VBO. Perhaps this thread helps: #984938: Migrate from Image Module galleries to Node Gallery/Imagefields

justintime’s picture

Title: Can NG3 be installed utlizing pre-existing Node Types? » Conversion script to convert multiple imagefields on a node to NG3 (e.g. views_gallery => NG3)
Category: support » feature
Status: Active » Postponed

jjjames - that, at the moment, isn't supported. Lullabot's famous blog post recommends the gallery be the node, and the images be attached to the gallery node as just imagefields, not separate nodes.

It's certainly not impossible to do, it would just require a script that this module's developers don't have time to write at the moment. This would be a great user contrib if someone would like to step up.

scroogie’s picture

Justin, what do you think about extracting some common code of these update scripts to facilitate migration. Perhaps we could have a function to create an image node from a fid or an image node from a filepath with the gallery id as additional parameter. We could take the code from plupload.module? That way people would only have to worry about retrieving the galleries and filepaths, not about our part of how to create stuff. It shouldn't be too much code, only respecting the default types and relationships, but it will probably make life easier for some people.

justintime’s picture

Ideally, we could release a series of drush scripts to do this, but the reason I postponed is because the API's/functions are all in NG core to do this. We can add these scripts after release without risking introducing bugs in NG core. I also want to let this sit for a bit, because I have a feeling we'll be hitting a critical mass of NG3 awareness soon, and will likely start to have many requests to migrate.

Finally, once we hit 3.0 as a recommended release, the likelihood of a paid Drupal shop needing to write code for someone to do this is much greater, and they may contribute said code back to the project.

So, I guess what I'm saying, is that it *will* get done, but likely will wait until after 3.0 is the recommended version for a bit.

jjjames’s picture

It creates a node for each image. This is the method:
http://www.lullabot.com/articles/photo-galleries-views-attach

Thanks

justintime’s picture

@jjjames - it creates a node for each *gallery*, but uses multiple imagefields attached to one gallery node to represent the images. One imagefield doesn't equal one node.

jjjames’s picture

Version: 6.x-3.0-alpha1 » 6.x-3.0-alpha2

Hmm you sure? I guess I did it wrong then. I'm using a method where i have a gallery type and an image type. Each image = a node and has a node_ref field that points to the gallery.

Any idea how I could seamlessly implement NG3 and use my existing galleries and image nodes?
thanks!

justintime’s picture

My bad - there are separate node types associated with a nodereference field in that example. That's how views_gallery does it too.

I'd love to do this, but just don't have time right now. If you know someone who knows Drupal & PHP, here's the gist of what they need to do:

1) Create a relationship that associates the gallery type to the image type
2) node_load() and node_save() each gallery node. This will insert it into the node_gallery_galleries table.
3) node_load() each image node. Find out the nid of the parent gallery, and assign that to $node->gid. node_save() the image node. This will add the entry to the node_gallery_images table.

Pretty simple really, but I just don't have time right now.

jjjames’s picture

cool thanks! if i get some code i'll share it

Summit’s picture

subscribing, greetings, Martijn

zengenuity’s picture

Status: Postponed » Closed (works as designed)