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

    I am using the gallery with galariffic plugin.
    I have created the "GalleryAlbums" and gave it a rowTpl (chunk).
    As for displaying all the albums, that works perfectly.

    The problem I am having is that i want to differenciate between main albums and its sub albums.

    Here is my chunk?
    <li[[+cls:notempty=``]]>
    <a href="[[~[[*id]]? &[[+albumRequestVar]]=`[[+id]]`]]">
    [[+name]]</li>


    this is the output i want:
    <li>
    <a>main album 1</a>
    <ul><li>sub album 1></li><li>sub album 2></li></ul>
    </li>
    <li>
    <a>main album 2</a>
    <ul><li>sub album 1></li><li>sub album 2></li></ul>
    </li>


    How do i do that?
    [ed. note: meytal1 last edited this post 14 years, 9 months ago.]
      • 6955 ☆ A M B ☆
      • 147 Posts
      I'd like to know this as well - since I am also working on something very similiar to this.. Right now when I select a Gallery and choose the parent Gallery it shows all Gallery even if it is a different parent.
        Billy Koch
        Follow me on Twitter: @DefKoch
        Skype: billyk0ch
        • 18373 ☆ A M B ☆
        • 3,141 Posts
        Something like this should do the trick:

        <ul>
        [[GalleryAlbums? &parent=`0` &showAll=`0` &rowTpl=`gallery-parent-tpl`]]
        </ul>


        Then in the gallery-parent-tpl chunk call galleryAlbums again, something along these lines should suit your need:

        <li>
          <a>[[+name]]</a>
          <ul>
              [[GalleryAlbums? &parent=`[[+id]]` &showAll=`0` &rowTpl=`gallery-sub-tpl`]]
           </ul>
        </li>

        where gallery-sub-tpl is just a list like the chunk you posted:
        <li[[+cls:notempty=``]]>
        <a href="[[~[[*id]]? &[[+albumRequestVar]]=`[[+id]]`]]">
        [[+name]]</li>
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
          • 37317
          • 77 Posts
          Mark, this seems to work well.
          A bit of tweaking, but otherwise, great.
          10x
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            If there was anything wrong in the code I posted (didn't actually test it), I'd appreciate if you could point it out so we can help others who find this thread months from now as well smiley
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 37317
              • 77 Posts
              HI Mark,

              I am still having some issues with the manager itself. Once I get that sorted, I will post my code as in regards to this thread.
              10x again smiley

                • 37317
                • 77 Posts
                hi mark,

                I pretty much did as you wrote above.

                In the sub chunk, there is a </a> missing.

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


                10x
                  • 26503
                  • 620 Posts
                  Billy;

                  did you ever solve that parent thing - I am having the same problem &parent=`whatever` is selecting all galleries no matter what I do... [modx 2.2]

                  [[!GalleryAlbums? &parent=`5` &showall=`0` &prominentOnly=`0` &sort=`rank` &dir=`asc`]]
                  


                  UPDATE:
                  never mind... &showall should be &showAll [ed. note: sean69 last edited this post 14 years, 7 months ago.]
                    *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

                    Sean Kimball CLP, CLS.
                    Technical Director / Sr. Developer | BigBlock Studios
                    ._______________________________________________.
                    Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
                    27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
                    phone/fax: 905-426-5525