We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27437
    • 49 Posts
    Hi all,

    I’m working on http://meubelrestauratie.nu/fotogalerij.html

    I have setup the Gallery addon with the Galleriffic plugin and they work great. But I don’t know how I can go to the next or previous Album when I am in a certain album.

    If u take a look at http://meubelrestauratie.nu/fotogalerij.html?galAlbum=15 then you will see 2 buttons on the top right and they are used to skip pictures forward and backward, I would like to have buttons to navigate to the next and previous albums.

    Can anyone point me in the direction I need to go.

    I want to modify the galleriffic.js at the render navigation part something like this

    if (this.renderNavControls) {
    	this.$controlsContainer
    		.append('<div class="nav-controls"> '+this.previousAlbum+' <a class="prev" rel="history" title="'+this.prevLinkText+'">'+this.prevLinkText+'</a> | <a class="next" rel="history" title="'+this.nextLinkText+'">'+this.nextLinkText+'</a> '+this.nextAlbum+' </div>')
    		.find('div.nav-controls a')
    		.click(function(e) {
    			gallery.clickHandler(e, this);
    		});
    }
    


    So I can get it to work when I can send the correct numbers for the albums in 1. this.previousAlbum and 2. this.prevLinkText

    [[!Gallery? 
    	&toPlaceholder=`Gallery`
    	&previousAlbum=``
    	&nextAlbum=``
    ]]
    


    I have tried getting something like [[*id]] in it, but here i’m really clueless

    All help appreciated!



      • 27437
      • 49 Posts
      bump
        • 37449
        • 57 Posts
        I’m not familiar with Gallerific (yet!) but have done lots of digging into Gallery snippet.

        How will you tell the snippet that the user has clicked "Next Album" or "Previous Album"?
        I assume you do NOT want a separate resource for them?


        Daz
        P.S. the galleries work very nicely - and some lovely pieces of furniture!
          formerly sumodaz on here!
          • 27437
          • 49 Posts
          Thanks for the replies even while the answer isn’t really in here yet.

          -- How will you tell the snippet that the user has clicked "Next Album" or "Previous Album"?
          I think it needs to be the other way around.
          I think I need to make a function in the gallery plugin for it. Somewhere the plugin must have some kind of an array for the albums. Then if an album loads on the page I should figure out by this list what’s the current album, the previous album and what the next album is. Then it should produce the according links somehow to these albums. Somehow like the gallery snippet is doing this already for ALL the albums.

          Still if people know in what direction I need to look, I’ll be grateful.

            • 37449
            • 57 Posts
            Ah yes, I see what you mean....

            There is the galAlbum parameter which tells the call what the current id is, so perhaps it will be something like:

            get current album id
            nextAlbum = CurrentAlbum + 1
            if CurrentAlbum not exist then nextAlbum = 1
            previousAlbum = CurrentAlbum - 1
            if previousAlbum not exist then previousAlbum = max(album count)
            


            So, that would set the two additional parameters
            Then, in the template, the "Next Album" button would be a link to the existing resource, but setting galAlbum to nextAlbum...

            <li[[+cls:notempty=``]]><a href="[[~[[*id]]? &[[+albumRequestVar]]=`[[+nextAlbum]]`]]">[[+showName:notempty=`[[+name]]`]]</a></li>
            




            Something like this?
              formerly sumodaz on here!
              • 41958
              • 65 Posts
              Hello.

              I have this call [[!GalleryAlbums ]] in my template.
              How to put class="active" on the link for the selected gallery almbum (or any other css call)?
              thx