We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    Not that I can see, assuming that Gallery sets all those placeholders. Are you getting any output at all from the runSnippet() call? Is there anything in the MODX Error Log?
      Did I help you? Buy me a beer
      Get my Book: MODX:The Official Guide
      MODX info for everyone: http://bobsguides.com/modx.html
      My MODX Extras
      Bob's Guides is now hosted at A2 MODX Hosting
      • 36924 ☆ A M B ☆
      • 298 Posts
      No output at all.

      The only repeated error log I see since the 18th of June to date:

      [2014-06-25 04:34:13] (ERROR @ /nestnew/nboss/index.php) Could not load class: Tagger from tagger.
      [2014-06-25 04:34:13] (ERROR @ /nestnew/nboss/index.php) Problem getting service tagger, instance of class Tagger, from path C:/wamp/www/nestnew/ore/components/tagger/model/tagger/


      The repeated error before that is:

      [2014-06-18 15:51:28] (ERROR @ C:\wamp\www\nestnew\ore\xpdo\cache\xpdocachemanager.class.php : 510) PHP warning: unlink(C:/wamp/www/nestnew/ore/cache/includes/elements/modsnippet/19.include.cache.php) [<a href='function.unlink'>function.unlink</a>]: No such file or directory
      [2014-06-18 15:51:28] (ERROR @ C:\wamp\www\nestnew\ore\xpdo\cache\xpdocachemanager.class.php : 518) PHP warning: closedir(): 172 is not a valid Directory resource


      Now neither looks like the culprit.


      I have tried all three call methods:

      $fields = array(    /* to hold Gallery snippet call */
         $album => $resource->getTVValue('ActivityAlbumTitle'),
         $toPlaceholder => 'gallery',
         $limit => 1,
         $tag => 'lead',
         $thumbTpl => 'nest_galItemLink',
         $linkToImage => 1
      );
      
      $output .= $modx->runSnippet('Gallery', $fields);   /* to output Gallery snippet call */
       
      $fields2 = array(     /* to hold Gallery snippet call */
         $album => 'nctl',
         $toPlaceholder => 'gallery2',
         $tag => 'follow',
         $thumbTpl => 'nest_galItemFollowLink',
         $linkToImage => 1
      );
      
      $output .= $modx->runSnippet('Gallery', $fields2);   /* to output Gallery snippet call */
      
      
      $output .= $modx->runSnippet('Gallery', array(
         $album => $resource->getTVValue('ActivityAlbumTitle'),
         $toPlaceholder => 'gallery',
         $limit => 1,
         $tag => 'lead',
         $thumbTpl => 'nest_galItemLink',
         $linkToImage => 1
      ));   /* to output Gallery snippet call */
      
      
      
      $fields3  = array();
      $fields3['album'] =  $resource->getTVValue('ActivityAlbumTitle');
      $fields3['toPlaceholder'] =  'gallery';
      $fields3['limit'] =  1;
      $fields3['tag'] = 'lead';
      $fields3['thumbTpl'] =  'nest_galItemLink';
      $fields3['linkToImage'] =  1;
      
      $output .= $modx->runSnippet('Gallery', $fields3);   /* to output Gallery snippet call */
      [ed. note: ojchris last edited this post 12 years, 3 months ago.]
        • 3749
        • 24,544 Posts
        Try using this version:

        $fields3  = array();
        $fields3['album'] =  $resource->getTVValue('ActivityAlbumTitle');
        $fields3['toPlaceholder'] =  'gallery';
        $fields3['limit'] =  1;
        $fields3['tag'] = 'lead';
        $fields3['thumbTpl'] =  'nest_galItemLink';
        $fields3['linkToImage'] =  1;
        


        and hard-coding a real album title in this member:

        $fields3['album'] =  $resource->getTVValue('ActivityAlbumTitle');


        e.g.,

        $fields3['album'] =  'MyAlbum';
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 36924 ☆ A M B ☆
          • 298 Posts
          Still no luck.
            • 3749
            • 24,544 Posts
            Sorry, I'm baffled. If the gallery tag works, I can't think of any reason why a $runSnippet() call with the same properties wouldn't return the same output unless the gallery pages are protected in some way and there is a different user (with different permissions) for each of the two conditions.

              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 36924 ☆ A M B ☆
              • 298 Posts
              Thanks Bob. It's a shame that after 15 days on these together the smallest most important part have failed to work out. But I'm encouraged knowing the working part of the code will be useful in several scenarios. As far as categories are involve this will be my goes snippet.

              I'm working on my local machine could that be the reason runSnippet never got to work?

              I'm giving up already.
                • 3749
                • 24,544 Posts
                If PHP works on your local machine, it's unlikely that doing it locally is an issue. TBH, the most likely issue is a typo somewhere, e.g., a misspelled variable name, property name, or chunk name.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 36924 ☆ A M B ☆
                  • 298 Posts
                  Do you know if there is a way to achieve this with getResources without getting duplicate values. To not output I'm having to set tvFilters with an actual category value (e.g. &tvFilters=`ActivityCategory===CONSTRUCTION`)
                    • 3749
                    • 24,544 Posts
                    I don't know of any way to do that with GR. Sorry.

                    Maybe someone else has an idea.
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 36924 ☆ A M B ☆
                      • 298 Posts
                      BobRay. Thank you for the help. I settled with using GR with hardcoded categories. Very grateful.