We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5950
    • 44 Posts
    I have a page on my site that displays another resource’s childgallery (I don’t think that’s important in the case of this issue, though).

    I have already figured out how to get the latest image to show with &order_by=’pos’ and &sort=’DESC’

    Unfortunately that makes the ’previous’ picture the ’next’ picture (in terms of hitting "next" or "previous" in the created links).

    I’d like, instead, to change the start position (&pictureview_start_pos) to the last image, but in order to make updating as easy as possible, I’d like a value that automatically indicates the last picture uploaded in that gallery. Then it could still sort ascending (and therefor the other images in the gallery would be reached via the ’Previous’ link).

    Is there a value for this?
      • 7923
      • 4,213 Posts
      Do you mean that;

      1. You have a childgallery list on some document that lists galleries under some specific document?
      2. And you want this list to display the latest image from the galleries?
      3. And when you click to go to some of the galleries, you want it to go to the last picture in picture view mode?
      4. And next picture button should be disabled and previous show the second latest picture?

      For 1 & 2, you should use [!MaxiGallery? &display="childgalleries" &order_by=`date` &order_direction=`DESC` &childgalleries_ids=`50`!]

      For 3 & 4, create childgalleryTpl chunk like this:
      <li>
      	<a href="[~[+maxigallery.pageinfo.id+]~]&pic=[+maxigallery.picture.id+]&from_id=[*id*]">
      		<img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" class="thumbnail" title="[+maxigallery.strings.go_to_gallery+]" alt="[+maxigallery.strings.go_to_gallery+]" />
      	</a>
      	<p style="width:[+maxigallery.picture_width_thumb+]px; margin:0 auto;">[+maxigallery.pageinfo.pagetitle:htmlent+]</p>
      </li>
      


      And add it to the above call with &childgalleryTpl parameter.

      Not sure that I got your question though..


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 5950
        • 44 Posts
        Thanks for your reply, Doze.

        Let me see if I can explain it better. I don’t think what you described is exactly what I am trying to do, but I’m fairly new to MaxiGallery.

        I’m attaching a screen cap of my hierarchy tree.

        I’d like Latest Comic (17) to display Chapter 4 (16), which is already a child gallery of Archive (2). I still want Chapter 4 (16) to view in ascending id order when viewed directly, but I want the Latest Comic (17) page to display the images from Chapter 4 (16) backwards within its own contents.

        LOL, does that make any more sense?
          • 7923
          • 4,213 Posts
          What kind of view you want to doc id 17? all thumbnails from doc id 16 that open with slimbox? or if no slimbox, what then? or just one thumbnail from doc id 16? what should happen then if the picture is clicked? What should show in doc id 16?

          Etc.. I need much more info.


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 5950
            • 44 Posts
            It would preferably be pictureview.

            Here’s the site it’s on: http://www.nativecomic.com/

            I essentially want it to work just like it does on http://www.nativecomic.com/archive/chapter-4.html
            except that it would start from the last page (with "previous" used to go to earlier pages).
              • 7923
              • 4,213 Posts
              Ok.. I get it now, i think.

              You could get the most recent document under archive with Ditto for example, eg. use something like

              [!Ditto? &parents=`2`&orderBy=`createdon DESC` &display=`1` &total=`1` &tpl=`gallery`!]
              


              Then create a chunk called ’gallery’ where you call maxigallery to view the most recent gallery:

              [[MaxiGallery? &view_gallery=`[+id+]` &display=`pictureview` &pictureview_start_pos=`[!MaxiGallery? &view_gallery=`[+id+]` &galleryOuterTpl=`picscount`!]`]]
              


              Then create a chunk called ’picscount’ with something like this:

              [+maxigallery.picscount+]
              


              Alot of overhead, but it should work.. make sure you use v0.6 test version. I believe there was some bugs with [+maxigallery.picscount+] in some version..


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 5950
                • 44 Posts
                Ooh, very close!

                Just one problem.. it tries to start with image 36 of 35. Is there some setting I can look for to compensate for its enthusiastic count?
                  • 26931
                  • 2,314 Posts
                  Just one problem.. it tries to start with image 36 of 35. Is there some setting I can look for to compensate for its enthusiastic count?
                  try:
                  [+maxigallery.picscount:math=`?-1`+]
                    • 5950
                    • 44 Posts
                    Quote from: sharkbait at Feb 13, 2010, 01:21 AM
                    try:
                    [+maxigallery.picscount:math=`?-1`+]

                    Same result, I’m afraid. Thanks though!
                      • 7923
                      • 4,213 Posts
                      Hmm.. that should have actually done it.. You could write a snippet that does the same thing.. but the phx modifier should have done it too.

                      Check your apache error logs to see if there are some eval error or something..


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."