0

It's not easy to explain so I made simple example below. I'm making a gallery in Drupal 8. First I made articles with taxonomy term: animals, forest or people. Some of articles have two or three taxonomy terms. Each article contains 1-5 photos. The main page (gallery) displays a main photo from each article (picture 1). As you can see when you click FOREST gallery shows all articles contain 'forest' taxonomy (picture 2). When someone click on a thumbnail from the forest gallery then a page (picture 3) appears and we can see our tree with 2 more photos (for example colorbox) plus some comments and thumbnails of articles with forest taxonomy above. Picture 4 is easy to understand. Additionaly when you click on a thumbnail from NEWEST(ALL) gallery the next and previous articles has to include all taxonomy terms or just all photo articles.

I've made a few projects but none of them can do this all same time. Is there a way to make this photo gallery? It looks like a basic gallery but I couldn't find solution or module.

enter image description here

EDIT 2019-11-27: From the beginning: I have articles (with photos) that have taxonomy term.I have views for each taxonomy term. For example, for the "People" category, I have a view that displays the title and thumbnail photo from each article that has "People" taxonomy. If the article has two taxonomy terms, its thumbnail is displayed, for example, in the "People" view and the "Forest" view. And that's ok. I also have a pager for every taxonomy, made by the Entity pager module, which is a block. I would like this pager to be displayed in the article. But now, if I have an article that has two taxonomy term, it displays two pagers. I would like only one to be displayed. If I click on the article shortcut in the "People" view (and this article has the taxonomy term "People" and "Forest") I would like this article to display the "People" pager only. If I click the same article thumbnail, but in the "Forest" view, I would like only the "Forest" pager to be displayed in this article. Is it even possible to do this?

0

This is quite a bit more complicated than your previous question.

My best advice would be that in order to get each content node to have a gallery with multiple images, each Article node should use an image field with multiple values.

These "child sideshows" will be completely separate from the "parent slideshow" which is the one using Views with the taxonomy filters (e.g., "Previous / Next Forest").

You should still be able to make the "child slideshow" into a scrollable gallery as you show in your thumbnails (e.g., "Previous / Next image in Article") by using a library like SlickSlider.

This Drupal.org issue queue talks about setting up Slick without Views as a "multi-imagefield single-node slick on D8" so it can definitely be done. (The Slick Extras module may help, but I haven't tried it so I'm not sure.)

It will be a bit more work this way, and not all the advice you find online will be completely applicable to your situation. If you get stuck, I recommend following the Javascript code in the Slick demos rather than any Drupal-specific walkthroughs.

Good luck!

EDIT 2019-11-27: Thanks, the comment below helps me to understand what you're trying to do.

The real problem is that your data model is a mess: you want to apply the taxonomy terms to the Article (child slideshows) content type, and also to the individual photos within the Articles. You apparently don't want to display all the photos in each Article, but only the individual photos that match the selected taxonomy term in the parent. That wasn't very clear from your earlier description.

To accomplish that, I think you'll need to implement the term filters (Animals, Forest, People) as an exposed filter on the child slideshow. You can't filter by the taxonomy terms on the child node because you want to jumble terms together at both levels.

This is made more complex by the fact that you want the same buttons to act as exposed filters on two different Views. No wonder you are having trouble.

Maybe you can use a contextual filter on the child slideshow that refers to the value of the exposed filter on the parent.

  • 1
    I'm not sure I understood you correctly. I have already done these "child slideshows" (Fotorama module). I just still don't know how to display the pager (block) depending on the view I came from .This is my problem. For example, if you go from the "Forest" view, the article should only display "pager" to "Forest", even if the article has both taxonomies forest and people. Currently, if articles have double taxonomy, two pagers are displayed. The same if I go from the "All" view in the article there will be a pager navigating to all articles. – Skylar Hunting Nov 27 '19 at 9:57
  • Actually, I want all photos in articles to be displayed. This "child slideshow" is irrelevant. We can even assume that there is one picture in each article. The point is that some articles has, for example, two taxonomy term. I do not add taxonomy to photos, only to articles.I edited my description, maybe it will be more understandable now. – Skylar Hunting Nov 27 '19 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.