We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15566
    • 73 Posts
    I am using the Gallery package in an site I am building. I can get Gallery to work, but I don't get anything from GalleryItem.

    I am using this: [[!GalleryItem?id=`9`&tpl=`galRow`]]

    There is an image with id=9

    I have a galRow chunk containing this:

    <div class="image">
    TEST<a href="[[+galitem.image]]">
    <img src="[[+galitem.image]]" alt="[[+galitem.name]]" />
    </a>

    Albums: [[+galitem.albums]]

    Tags: [[+galitem.tags]]
    </div>

    Any idea? I am using Gallery verion 1.4
      • 15566
      • 73 Posts
      Any body an ideas? It's have only had a few views. FFS my code has vanished. Here is my message agin:

      I am using the Gallery package in an site I am building. I can get Gallery to work, but I don't get anything from GalleryItem.

      I am using this:

      [[!GalleryItem?id=`9`&tpl=`galRow`]]

      There is an image with id 9

      I have a galRow chunk containing this:

      <div class="image">
        TEST<a href="[[+galitem.image]]">
          <img src="[[+galitem.image]]" alt="[[+galitem.name]]" />
        </a>
        <br />Albums: [[+galitem.albums]]
        <br />Tags: [[+galitem.tags]]
      </div>


      Any idea? I am using Gallery version 1.4
        • 3866 ☆ A M B ☆
        • 350 Posts
        Your snippet call doesn't have any space between properties and you've missed an '&' from id, try:

        [[!GalleryItem? &id=`9` &tpl=`galRow`]]


        Thanks for your time this morning too!
          Helen Warner
          Number one pixel!
          Proud to be linked with MODX at Crimson Pixel
          • 15566
          • 73 Posts
          The spaces and & don't make any difference (I have just tried it to make sure).

          Spaces are just spaces and are ignored outside the snippet name and the `` quotes.

          The initial & after the ? also isn't needed as it's the first variable - they're just needed to add further vars.
            • 3866 ☆ A M B ☆
            • 350 Posts
            Funny that because I tried the code on a gallery I'm running and it works ok - which version of modx are you using this in?
              Helen Warner
              Number one pixel!
              Proud to be linked with MODX at Crimson Pixel
              • 15566
              • 73 Posts
              2.0.7

              I am probably being very lazy and the best route for me to take is to upgrade to the latest version!
                • 3866 ☆ A M B ☆
                • 350 Posts
                Ah, I think this may be the case as I'm running this on a Gallery in 2.1.5 .... Upgrade to 2.2 and you're in for an even bigger change...

                Have a couple of sites in development using 2.2 and I'm just about to start using Gallery on one so will see if this results in any issues wink
                  Helen Warner
                  Number one pixel!
                  Proud to be linked with MODX at Crimson Pixel
                  • 15566
                  • 73 Posts
                  I might just make a small upgrade to 2.1.5 rather than going all the way. The site in question is a freebie for somebody and I don't want to spend the time fixing my custom code if 2.2 is a step too far!

                  I will report back with news.
                    • 15566
                    • 73 Posts
                    I found the problem at the weekend after going through GalleryItem line-by-line I found that it was getting to this line:

                    if ($toPlaceholders)


                    Where it was still actioning it and therefore not reaching the template call - after commenting it out it started working. After reading back all the variable options for GalleryItem it seems that toPlaceholders is set to 1 by default rather than 0 - which id expect normally.

                    Ps. I did upgrade to MODx 2.1.3 but forgot that some of the language changed since 2.1 so I have to rewrite some of my custom snippets.
                      • 3866 ☆ A M B ☆
                      • 350 Posts
                      Glad you got it resolved. Some of those default settings can be difficult to spot.
                        Helen Warner
                        Number one pixel!
                        Proud to be linked with MODX at Crimson Pixel