I’m using a gallery called Shuffle.js – https://vestride.github.io/Shuffle/ – for a house painter’s website. The gallery sorts by service type (i.e. “carpentry, etc.”) and it functions fine. I have links on individual service pages under the “What Makes Us Different” paragraph – https://scotlandpaintingco.com/carpentry.html – that say “see more examples of our carpentry work” that link to the gallery on the “Our Work” page – https://scotlandpaintingco.com/our-work.html. What I’m trying to do is make a unique href for each service page that links to the gallery already filtered for that category on page load (i.e. “carpentry”) instead of “Show All”.
I haven’t been able to figure out how to implement this but understand that I need to use JS to add a fragment link to “our-work.html”. (i.e. “our-work.html#carpentry”) whenever a specific filter is selected, and the fragment must have the service value (the gallery uses data-groups). Then I can link from the service pages using a url with the hashtag. I keep coming across “window.location.hash” in other forums but I can’t figure out how to use this to accomplish my goal or how to integrate it into the code.