any chance that this will ever be ported to D7, to perform a similar role for Node Gallery 7.x-1.0 ?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scroogie’s picture

Unfortunately a straight port is not possible, as far as I judge things at least, as the architecture of node gallery changed significantly with D7. I would like to upgrade the module, but until now, I simply didn't have enough time.

Aonoa’s picture

I would very much like this functionality in D7 as well, is it being worked on? :-)

Best regards,
Ao

Celerity’s picture

I too would be interested in a D7 port. Just jumping on the wagon.
-cel

bkat’s picture

Issue summary: View changes
FileSize
7.15 KB

I got hierarchical galleries working in Drupal 7 without a specialized module. I did it as follows

  1. In the gallery content type, add a field named field_parent_gallery that is an entity reference to type Gallery. Make sure the mode is "Simple" and not "Node Gallery". Something in the Node Gallery mode prevents you from saving a value for a gallery
  2. Create a view named Node Gallery Subgalleries that returns all the galleries whose field_parent_gallery is the gallery that you are viewing. (See attached file node_galleries_subgalleries.txt)
  3. Modify Node Gallery: Gallery Item Views to inject Node Gallery Subgalleries as a header (Global:View area). (See attached file node_gallery_gallery_item_views.txt)
  4. Modify Node Gallery: Gallery Summaries to only display galleries where Parent Galley is empty (see attached file node_gallery_gallery_summaries.txt)

Now when you edit a gallery, you can set the parent gallery. The main galleries page will only display the galleries that don't have a parent and when you view a gallery, it will display any child galleries before the gallery images.

Some things that could be done better:

  1. Is there anyway to list the parent galleries selection list in a hierarchical manner?
  2. Child galleries are not included in a gallery item count
  3. A gallery with just child galleries, will not have a cover image
  4. No way to customize the order of the child galleries on a per gallery basis. You can change it globally my modifying the view

You can check out my work in progress at https://usafl.com/galleries

bkat’s picture

Ayran’s picture

Hi bkat,

I totally like what you have done here!

Unfortunately I cannot import your views, and have some problems implementing it, so may I ask you for a more detailed tutorial, please?

Thanks

Ayran’s picture

Oh, sorry, my bad. All is fine.

Thanks again, this is genius, seriously. I think it should be part of the Node Gallery standard package.

bkat’s picture

Glad it helped someone out Ayran.

Ayran’s picture

FYI - in all my galleries, including these containing only nested galleries and no images, I have placed a dedicated cover image and than have offset 1 in the pager settings. Like this the dedicated cover is hidden from view but is still used as cover.

The minor drawback is that I have "Image count:1" on the Summaries page, as in your example. There is no solution to that yet, I presume? It will rock if there is way to put subgalleries count as well.

bkat’s picture

I haven't really spent any time looking at the minor issues since its working "good enough" for now.

bdornbush’s picture

bkat,
I created the field named field_parent_gallery.
When I tried to add the view node_gallery_subgalleries, I get an error message:
Field handler field_data_field_node_gallery_image.field_node_gallery_image is not available.

Can you tell me what I might be missing?

Thanks,

bdornbush’s picture

bkat,
I found the problem with the view node_gallery_subgalleries. The default name for the field changed from field_node_gallery_image to node_gallery_media.

I tried to download the two additional views, and found that they are both the same. node_gallery_gallery_item_views.txt is actually for the view node_gallery_gallery_summaries, so we have that one twice. Can you upload the node_gallery_gallery_item_views.txt again?

Thanks,

bdornbush’s picture

I'm continuing to work on this. I modified Node Gallery: Gallery Item Views to inject Node Gallery Subgalleries as a header (Global:View area).

I modified Node Gallery: Gallery Summaries to only display galleries where Parent Galley is empty.

I created a gallery as a subgallery of another gallery. The lookup feature found the other gallery.

When I view the /galleries page, I see only the gallery that is not a subgallery. However, that gallery doesn't show the subgallery in a header view.

I have attached the views as I modified them, named the same as bkat's views with a "_1" suffix. Any idea why the subgallery is not appearing as a header view?