I’m making a gallery using Page Manager and Panels in Drupal 7.
Every painting in the gallery is related to a painter, a time period and several themes.
When navigating in the gallery, the user has three different routes to reach a specific painting:
- Through painters
- Through time periods
- Through themes
When on the page for a specific painting, I would like to make a pagination system, that shows the next and the previous painting, based on the route the user took to get to the specific painting.
So if you reach the page with a painting through painters, the next and previous buttons should show the next and previous paintings from that painter.
If you reach the page with a painting through time periods, the next and previous buttons should show the next and previous paintings from the specific time period.
And if you reach the page with a painting through themes, the next and precious buttons should show the next and previous paintings from that specific theme.
The paintings only have one url each: /painting/%node so I somehow need to know what route the user took to get to a specific painting in order to generate the correct previous and next buttons.
Anybody know a clever way to do this?
Place the gallery into the page via ajax/javascript after the page has loaded, this way you could use the javascript History object and send it to the view as an argument.