We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23299
    • 1,161 Posts
    I am back working with Revo. I have a functioning Gallery system that also uses the IF snippet and some jQuery. The container Gallery page has several sub galleries. These all work fine. When the user finishes viewing a sub gallery it just ends. I would like to add a link that says "back to main Gallery page" but I want this link to only appear on all the sub galleries and not the main container gallery?

    I am thinking I could add a TV to the gallery page template. The TV can then present the link text and the actual link. This works fine. But how do I prevent the TV from showing on the container Gallery page? So far its all on or all off.

    Thanks!
      • 31946
      • 116 Posts
      If the children (sub-galleries) have the same template as the gallery-container and the structure is only one level deep, maybe you could write the link in the template:
      [[*parent:eq=`ContainerID`:then=`<a href="[[~ContainerID]]">back to main Gallery page</a>`]]

      This way the link only shows up on the children of ContainerID.
        • 23299
        • 1,161 Posts
        Thanks for adding this..

        Do I need some kind of parent snippet to make this work?

        So, if my Gallery container page is resource 3 I would then add the following to the template:
        [[*parent:eq=`3`:then=`<a href="[[~3]]">back to main Gallery page</a>`]]


        I have tried this and nothing happens? [ed. note: Photowebmax last edited this post 12 years, 4 months ago.]
          • 31946
          • 116 Posts
          No, the
          [[*parent]]
          is a Template Tag like for example
           [[*pagetitle]]
          which holds the ID of the parent.
          http://rtfm.modx.com/display/revolution20/Commonly+Used+Template+Tags

          So basicly the outputfilter "eq" checks if the Parent of the current Resource has ID 3, if this is the case, the link is written.

          Does your structure look like this and does the Container and all childs have the same template?
          +(3)Gallery -> Container
          +---(x)gallery1 -> Child of Gallery
          +---(x)gallery2 -> Child of Gallery

          Then it should work.. maybe clearing the cache?
            • 23299
            • 1,161 Posts
            OK, me bad. Sorry! I have made a major error in describing my setup here...


            As it stands my Gallery page is not set as a container. The Gallery page is dynamically displaying the sub Albums I have created. I am so used to MaxiGallery under Evo which is why I am mixing up the terminology.

            So, on my Revo system I have a Gallery page that uses the Gallery and IF snippets. I am using the JAIL jQuery system as presented here: http://modxrules.com/articles/modx-revolution-gallery-with-colorbox-and-jquery-asynchronous-image-loader-jail

            The reason I am using this is that I can never get the regular Gallery snippet to perform the way I want it to. Everything I have installed and configured with custom CSS works great.

            All I want is some kind of "return to main Gallery page" link to appear on each album, but not on the actual Gallery page itself. Does this make sense? If the link appeared on the actual Gallery page it would just be a confusing link as it would just be link to itself...

            My snippet call:
            [[!GalleryAlbums? &toPlaceholder=`GalleryAlbums` &limit=`0` &albumCoverSort=`rank` &prominentOnly=`0` &rowTpl=`DemoGalAlbumRowTpl` &thumbWidth=`80` &thumbHeight=`80`]] [[!Gallery? &checkForRequestTagVar=`1` &toPlaceholder=`Gallery` &useCss=`0` &containerTpl=`DemoGalleryAlbumTpl` &thumbWidth=`80` &thumbHeight=`80` &thumbTpl=`DemoGalItemThumb` &imageWidth=`800` &imageHeight=`800`]] [[!If? &subject=`[[+Gallery]]` &operator=`isempty` &then=` [[+GalleryAlbums]] ` &else=` [[+Gallery]] `]]


            Thanks though! [ed. note: Photowebmax last edited this post 12 years, 4 months ago.]
              • 31946
              • 116 Posts
              No problem smiley
              I think you can modify the "DemoGalleryAlbumTpl" Chunk and insert your link there (taken from the demo):
              <h1>[[+album_name]]</h1>
              <p>[[+album_description]]</p>
              [[+thumbnails]]
              <a href="[[~3]]">return to main Gallery page</a>

              This way the link should appear below the Thumbnails of each Gallery
                • 23299
                • 1,161 Posts
                Wow, you beat me to it. I just sort of added the same thing after going through all five of my gallery chunks!

                Thanks so much!
                  • 31946
                  • 116 Posts
                  Glad it worked, you're welcome! smiley
                    • 38713
                    • 91 Posts
                    Hi

                    Can i just ask a question to expand on this.

                    say i have these urls which are the urls to each specific gallery page:
                    domain.co.uk/gallery/kitchens/Harrisons+Kitchen/
                    domain.co.uk/gallery/kitchens/Saxton Kitchen/
                    domain.co.uk/gallery/bedrooms/Ambers+Bedroom/

                    and in all cases i only want to go back up one level to the album selection pages (kitchens) or (bedrooms) how would i write that url?

                    Thanks in advance.
                      Twitter @alexmercenary