How to implement custom navigation so each gallery has a "next" and "previous" nav link?

jfriendjfriend Registered Users Posts: 8,097 Major grins
edited December 10, 2019 in SmugMug Customization

I'm trying to implement some custom navigation in each gallery page that let's the viewer go to the "next" gallery or the "previous" gallery without backing up the hierarchy to the parent folder and manually selecting the next gallery.

Here's some background.

I have a very large set of galleries that cover 15 years of family history. They are organized by year:

2004
.........Gallery A
.........Gallery B
.........Gallery C
2005
.........Gallery X
.........Gallery Y
.........Gallery Z

And, so on. There are ~500 galleries across 15 years. One thing some viewers would like to be able to do is to basically just browse sequentially through all the galleries. Open Gallery A, see what's there, go to Gallery B, see what's there, go to Gallery C, see what's there and go to Gallery X (which starts the next year) and so on...

Right now, the viewer has to go back up to the parent folder, find where they were last viewing and select the next gallery in order. It's fairly time consuming to just browse through the galleries this way.

So, I'd like the viewer to be able to just go directly to the "next" or "previous" gallery right from any gallery in this hierarchy via a couple links at the top of the gallery. I know that I could manually insert custom HTML at the top of every one of these galleries and manually construct a link to the next and previous galleries. But, with ~500 galleries, I do not relish the time consuming tasks of manually inserting the HTML into every page and continuing to do this as I add more galleries every year of goodness if I ever decided to reorganize my site and had to manually edit every one of them.

Is there any automated way to surface "next gallery" and "previous gallery" links?

If I was coding my own site, I could drop a master list of galleries into some Javascript (included by all galleries in this hierarchy) and use some custom Javascript to fill in the appropriate links into an HTML nav template in each page and I could write that in about 5 minutes. To add a new gallery to this site, I'd just drop it's relative link into the JS list and I'd be done. But, this isn't my own site and last I checked, custom Javascript was banned here (yes I'm still smarting from that change awhile ago as it gave me so much freedom to customize quickly and easily).

Any idea what my options are to implement this that does not involve manually creating next and prev links in every single gallery page?

--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question

Comments

Sign In or Register to comment.