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

    In our project we created a single page which is working as a template. All parameters are transmitted through URL. For example ID of this page is 481. At the end of the page should be placed a gallery. To find out ID of a specified gallery I’m running snippet. In my snippet I place ID in a variable $gallery. Then I have to call Maxigallery from a snippet with &view_gallery and my $gallery variable.

    Please advice how to run Maxigallery with &view_gallery from a snippet. I tried almost everything....

    Example would be appreciated...

    Best regards,
    Alex.
      • 4172
      • 5,888 Posts
      in your snippet:
      $modx->setPlaceholder( 'gallery' , $gallery );

      then you can call maxigallery with:
      &view_gallery=`[+gallery+]`


      Bruno
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 7923
        • 4,213 Posts
        And you can run snippets programmatically using $modx->runSnippet(), eg.
        <?php
        $output = $modx->runSnippet(
                "MaxiGallery",
                array(
                    "view_gallery" => $gallery,
                    "display" => "embedded"
                )
        );
        return $output;
        


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 4456
          • 9 Posts
          I’m trying to run MaxiGallery in manager mode from a snippet like this:
          <?php
          echo $modx->runSnippet('MaxiGallery', array(
          	'display' => 'embedded',
          	'embedtype' => 'slimbox',
          	'pics_per_row' => 3,
          	'max_thumb_size' => 110,
          	'max_pic_size' => 0,
          	'thumb_use_dropshadow' => 0,
          	'manage_gallery' => 12,
          	));
          
          ?>

          and the result is that the gallery is displayed with the manage button.

          So far - so good, but what do I need to change to make MaxiGallery go into manager mode immediately?

          I can get it to work when I add mode=admin to the URL, but that is not a workable solution for me - is there any other way to do this?

          The goal is to be able to go into manager mode from within the document edit page in the manager, without having to click the manage button....

          Never mind - forgot I had a MaxiGallery call in the template and that the template doesn’t pull in the document content (on purpose).
          Got it to work by pushing mode=admin in the $_REQUEST array before calling MaxiGallery.

          Terry