Hi all,
i want to link the cover image view display to the full gallery view, but i can't achieve this.
I created a view filtering nodes of type 'gallery';
if I show 'content', i can only achieve that cover gallery is linked to his file.
if I show 'fields', I can't achieve showing the cover gallery.
How can I resolve my problem?
Sorry for my bad english,
thank in advance.
Edubacco
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 1854178-node-gallery-add-cover-view-mode-12.patch | 11.46 KB | zengenuity |
| #5 | 1854178-node-gallery-add-cover-view-mode.patch | 9.4 KB | zengenuity |
Comments
Comment #1
edubacco commentedI've added this relationship to my view: node gallery: Gallery cover item.
Then, showing fields, I've selected this field: (Gallery cover item) content: gallery media.
Like in the link-cover.html page of the help section of the module,
I've selected rewrite this fileld as a link, and i've added node/!1 as url.But this path relate to the single image instead of the gallery page.
Wich url I've to write?
Thanks
Edubacco
EDIT:
this field is naturally linked to its node page, and selecting display this field as a link has no effect.
I feel me like in a vicious circle, this was my first problem.
There's something I can't understand, but i can't find what.
Comment #2
zengenuity commentedYou are not doing anything wrong. This a bug with the current gallery grid view. (and with your custom view)
I need to think about how to handle this. It seems like I need another view mode for the gallery items that is specifically for gallery covers. One that is not linked to the node by default.
Comment #3
scroogie commentedJust as a note, in D6 we did this through a CCK field formatter that linked to the gallery. In my opinion, it is nice to have this also for other images, not just the cover. E.g. we typically have a preview of 3 to 4 images, that all link to the gallery by default. You can also use this in other places then.
Providing 2 field formatters in NG (one linking to the image and one to the gallery) would probably also render the file entity link module dependency obsolete.
Comment #4
edubacco commentedThanks for your answer zengenuity. Now I'm finding a way to select directly the image field, filtering only covers and than linking it to the album. But i can't achieve this.
Comment #5
zengenuity commentedAttached is a patch which should make linking to the gallery possible. Apply the patch, then run update.php. After update, you will need to go edit your view, and on the media file instead of view mode Node Gallery File Thumbnail, choose Node Gallery File Cover. That should give you a link to the gallery with the thumbnail of the item.
I'm getting rid of the dependency on File Entity Link module with this patch. There is a new option in its place from NG API that allows linking to the gallery item or the gallery. The update script sets reasonable defaults. Note: this patch currently works only on update. I still need to go back and make this change work with new installs.
Comment #6
edubacco commentedThank you very much zengenuity.
Now links to the gallery page works, but the view only show titles. Not images (covers).
I'm wrong with something?
I've applied the patch, runned update.php, disabled file entity link, modified media file of my view and restored the node gallery item view.
Comment #7
edubacco commentedIn the view page, i see these errors for every album:
Notice: Undefined index: node_gallery_node_cover in _node_gallery_api_gallery_view() (linea 1112 di drupalpath/sites/all/modules/node_gallery/node_gallery_api.module).
Notice: Undefined offset: 1 in _node_gallery_api_gallery_view() (linea 1112 di /drupalpath/sites/all/modules/node_gallery/node_gallery_api.module).
I think the first is linked with another module (it's not the first time i see it in this site), but the second has appeared after installing the patch.
Thanks
Comment #8
zengenuity commentedDid you make your own view or are you using the default galleries grid view that came with Node Gallery. If you made your own, can you export it and post it here?
Comment #9
edubacco commentedIt's a custom view, here the export:
Comment #10
zengenuity commentedYou need to use a relationship to get the cover item for the gallery, and you need to use fields in the view so you can get the title of the gallery with the image from the item. Try this version:
Comment #11
edubacco commentedok, now it works properly.
Thank you very much.
Can i make updates saftely? Or next update will delete the patch?
Comment #12
zengenuity commentedI made a few changes to that patch, and then committed them to dev. The changes were mainly related to making it work for a new install so I don't think you need to do anything on the next update. Your custom view should work.
For anyone else planning to apply the patch from #5, use the attached one instead. (@edubacco, you don't need to do this)
Comment #13
zengenuity commented