We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5950
    • 44 Posts
    My error logs are blank, and my webdeveloper’s toolbar doesn’t report any errors for the page.

    Does anyone else have any ideas? I guess if we can’t get it working I can figure out something else but I’d really like people to be able to scan back through the past few pages in case they missed a page.

    Thanks!
      • 7923
      • 4,213 Posts
      Dont know why the phx math isnt working for you, but like i said, you can do it with a snippet too:

      [[mysnippet? &val=`[+maxigallery.picscount+]`]]

      mysnippet:
      <?php
      return $val-1;
      ?>
      


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 5950
        • 44 Posts
        Ugh, still not working. huh

        Clearly I’ve got something funny going on, but I haven’t a clue where to start troubleshooting this.

        My Plan B is just to go back to what I had originally, eliminating the navigation and linking the image to the Archives page. But if I have an funny setting somewhere I’d rather work it out or it’ll just give me grief later on.

        undecided
          • 7923
          • 4,213 Posts
          Probably you are editing the wrong call / chunk / document. The snippet and the phx conditionals above should work. So triple check your setup.


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 5950
            • 44 Posts
            Just reviving this to describe my solution for anyone who might come across this thread because they have the same issue. smiley

            First, I’ve done a lot more with Ditto on other sites and realized that part of my trouble might have been a misconception about PHx being packaged in with Ditto (that what was built-in might be enough to handle modifiers such as the ones called here).

            Unfortunately that didn’t have any change!

            Luckily I also learned about Cacheable pages and PHx, so I verified that I had Cache-ing turned off on ~17~, which I did. Then I went through the bits and bobs suggested until it finally worked with the following code:

            Ditto Call in ~17~:
            [[Ditto? &parents=`2` &orderBy=`createdon DESC` &display=`1` &total=`1` &tpl=`gallery`]]



            Chunk "gallery":
            [[MaxiGallery? &view_gallery=`[+id+]` &display=`pictureview` &pictureview_start_pos=`[[MaxiGallery? &view_gallery=`[+id+]` &galleryOuterTpl=`picscount`]]`]]



            Chunk "picscount":
            [+maxigallery.picscount:math=`?-1`+]



            Thanks everyone for your help!

              • 5950
              • 44 Posts
              Blast! It couldn’t be that easy.

              Once the visitor has started clicking ’next’ or ’previous’ from ~17~, the first half of the Chunk "gallery" snippet call is being output on the page

              [[MaxiGallery? &view_gallery=`16` &display=`pictureview` &pictureview_start_pos=` 


              up until one reaches the call for the Chunk "picscount". The image still displays below this, followed by the closing `]]

              I’ll update if I figure out how to suppress this (I’ve already tried setting all the pages as uncacheable, LOL, no change), but I’d appreciate if anyone else could tip me off first! smiley
                • 7923
                • 4,213 Posts
                call ditto with [[ ]] on an uncached page and maxigallery with [! !] in ditto’s template.. or the other way around. It’s a feature of MODx evo branch that you need to alternate the caching level when you run snippets inside another snippets.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 5950
                  • 44 Posts
                  That’s what I thought I remembered reading once, but it didn’t seem to want to work with the proper nesting.

                  I tried with the innermost Maxigallery call [!’d, but that left the picture count one too high again. I swapped it so that the innermost was [[ and the penultimate Maxigallery call was [!, which loaded the proper image on the first call but gave the same errant script when moving forward or back.

                  So I turned on Cacheing, even though I thought I shouldn’t be able to with the PHx usage, leaving the settings as {!Maxigallery? ... `[[Maxigallery... and now it’s working. Not sure if I learned anything this time, but it’s working. Thanks doze and everyone else who lent a hand!