Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I've been trying this for a couple of days now, but can't figure out how..
I want to create a view (as a block) that displays all albums added. I Only want to show the cover image and the gallery/album title.
Could anyone please guide me how to do this?
Thanks alot.
Comment | File | Size | Author |
---|---|---|---|
#6 | gallery_block.txt | 2.61 KB | dbeall |
Comments
Comment #1
Rik CreditAttribution: Rik commentedHi Cholden,
Here you've got an example. Use the Views import functionality to import it.
Comment #2
dbeall CreditAttribution: dbeall commentedI will stick my nose in here for a second...
The above code uses panels and/or panes. To use the code without those, take this part out
Adjust the grid settings to suit your needs.
You can also add a 'page' view and a path after import to make a page.
Comment #3
cholden CreditAttribution: cholden commentedThanks for your replys.
I've imported the views-code which went fine. It also shows the galleries. The only problem is that it show each gallery the same mount of times as the number is images in each gallery.
I got two galleries (Test galleri & Reference galleri) with 5 images in each gallery.
Here's the result: http://grab.by/Jn3
I'm using the lastest version (6.x-2.0-alpha11)
Thanks.
Comment #4
dbeall CreditAttribution: dbeall commentedon the view, check to see that 'Distinct' is set to 'yes'
EDIT: BTW, you can also add a 'page' view to that and add a 'path' if you like.
Comment #5
cholden CreditAttribution: cholden commentedDistinct is set to yes.
And for my purpose block would be the best solution. But thanks for pointing it out anyway.
Here's a screenshot of my settings.
http://grab.by/Kij
Comment #6
dbeall CreditAttribution: dbeall commentedI have double checked this views code with an import and it works fine..
This is the same as the above, but it's in a normal block format(vertical unformatted).
The panels parts is removed..
Comment #7
cholden CreditAttribution: cholden commentedThats really weird.
I just importet the code in the .txt file, and i get the same result as before.
I've deleted the old images and galleries and created two new galleries (Album1 & Album2) with 9 & 5 images in. But still the same result.
http://grab.by/KqE
I really dont get why it creates an album for each image in the album..
Comment #8
dbeall CreditAttribution: dbeall commentedyes it is really weird.. for some reason the distinct setting in views is not working.
others have been finding this.. I posted a subscribe post in case something pops up..
http://drupal.org/node/140061 ;Node Distinct is not working anymore
Comment #9
Rik CreditAttribution: Rik commentedI imported the view again and it does show all thumbs from all galleries only one time. I'm using version 6.x-2.0-alpha11. Can it be you have not selected cover images? Because the view uses the coverimages.
Comment #10
dbeall CreditAttribution: dbeall commented@Rik, I used your code, just changed it a little trying to invoke a change that will wake it up. I have worked with your code and it seems to be just fine on my end.
duplicate issue, different views code:
http://drupal.org/node/640548 ;Gallery duplicates due to views distinct not working
Comment #11
Rik CreditAttribution: Rik commentedI'm suspecting that cholden needs to select a coverimage for each gallery.
Comment #12
dbeall CreditAttribution: dbeall commented@Rik,, you think he is letting the default take over for the cover image.. Instead of actually choosing or selecting one..?
interesting.. hmmm
EDIT: I'm using views 6.x-2.7
Comment #13
Rik CreditAttribution: Rik commentedFor the record I'm using Views version 6.x-3.0-alpha1.
Comment #14
Rik CreditAttribution: Rik commentedThat's indeed what I think, perhaps something going wrong with that. I know I selected all my cover images manually. Also the Views issue you are referring to is for version 5 of drupal and from 2007, I can't imagine its still broken :)
Comment #15
cholden CreditAttribution: cholden commentedI just selected new cover images for by albums instead of the default ones. Result is the same.
Maybe I should try another version of views? The 6.x-2.7 perhaps?
It seems like the 'Distinct' function is ignored.
Comment #16
cholden CreditAttribution: cholden commentedOh.
I just checked the changelog in the views folder, and I had 6.x-2.7. I just updated to the newest version 6.x-3.0-alpha1.
Doing this, solved my problem and made me happy.
Woohoo.
Thanks alot for your advices, suggestions and overall help.
http://grab.by/KEY
Love from Casper to helpers!
Comment #17
cholden CreditAttribution: cholden commentedAye.
I got a bonus-question.
How do I exclude one specific gallery?
Comment #18
dbeall CreditAttribution: dbeall commentedyou can use a filter by "Title" to exclude one gallery
this issue has been solved.. great ! --closed
Comment #19
cholden CreditAttribution: cholden commentedComment #20
dbeall CreditAttribution: dbeall commentedEdit: your right, I lost track of where this started... sorry
some views code was supplied by Rik..
added to handbook style views and theming:
http://drupal.org/node/544748