We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26503
    • 620 Posts
    I'm trying to get a gallery album thumbnail using getresources & galleryalbums, not sure how I can do this.

    I use getResources to grab a set of resources each with a TV for the gallery id associated with that resource, then I do something like this:

    
    [[!GalleryAlbums? &limit=`1` &start=`[[+tv.GalleryId]]` &rowTpl=`ProjecsListingThumbTpl`]]
    
    


    HOWEVER, the issue here is that this grabs the gallery item by index, not id. [it sort of works, just grabs the wrong gallery items because they are in a different order than the resources]

    Any ideas how I can do this?

    -thanks
    -sean
      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

      Sean Kimball CLP, CLS.
      Technical Director / Sr. Developer | BigBlock Studios
      ._______________________________________________.
      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
      phone/fax: 905-426-5525
      • 38142
      • 91 Posts
      Can't grasp what you are trying to do, but in your snippet call don't you need an * in the place of that +?
        • 26503
        • 620 Posts
        No the '+' is correct, the code there is located in a getResources Tpl. This would work justfine if I could somehow pass the gallery ID to the GalleryAlbums snippet instead of an index number
          *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

          Sean Kimball CLP, CLS.
          Technical Director / Sr. Developer | BigBlock Studios
          ._______________________________________________.
          Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
          27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
          phone/fax: 905-426-5525
          • 39559
          • 34 Posts
          Were you able to make this work? I am looking to do pretty much the same thing. My resources are pages which contain multiple galleries within the page. I am trying to use getResources to aggregate the 9 latest resources, and instead of using a text link, i want to use a thumbnail from the galleries that are contained within the resource.

          my resources and layout of the site is complete aside from this little issue for the front page aggregation, and ajax pagination on the galleries themselves
            • 26503
            • 620 Posts
            I was, not a lot of time to dig around and explain exactly what I did [sorry - working on another project], but here is the working source:


            the get resources chunk to call the resources with a galleryid set as a TV:
            
            <h2>Projects: [[*pagetitle]]</h2>
            <div id="projectsummary">
                 <div id="feature">
                      [[GetResources? 
                                &parents=`[[*id]]` 
                                &limit=`0` 
                                &level=`1` 
                                &includeTVs=`1` 
                                &processTVs=`0`
                                &tpl=`ProjectsListingTpl` 
                                &sortby=`pagetitle` 
                                &sortdir=`asc`
                      ]]
                 </div>
            </div>
            
            


            and the ProjectsListingTpl chunk:
            <dl>
            	<dd class="image">
            		<a href="[[~[[+id]]]]">
            		[[+tv.GalleryId:gt=`0`
            			:then=` [[Gallery? 
            						&album=`[[+tv.GalleryId]]` 
            						&limit=`1` 
            						&thumbTpl=`galProjectThumb` 
            						&thumbWidth=`92` 
            						&thumbHeight=`92` 
            					]]`
            			:else=`<img src="/Assets/Images/defaultthumb.gif" height="92" width="92">`
            		]]	
            		</a>
            	</dd>
            	<dd class="title">
            		<h4><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h4>
            	</dd>
            	<dd class="desc">[[+introtext]]<a href="[[~[[+id]]]]">  more...</a><br class="clearfix" />
            	</dd>
            </dl>
            


            the galProjectThumb chunk:
            <img class="[[+imgCls]]" src="[[+thumbnail]]" alt="[[+name]]" />
            


            so it's kind of dirty having to call the [[Gallery]] snippet like that, but it works... you could probably quite easily write a snippet to retrieve the thumb...
              *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

              Sean Kimball CLP, CLS.
              Technical Director / Sr. Developer | BigBlock Studios
              ._______________________________________________.
              Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
              27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
              phone/fax: 905-426-5525
              • 39559
              • 34 Posts
              thanks. i will have to keep playing around and see what i can come up with. this is one of those times i wish i knew php.....a snippet should be easy to make for this, but i'm not at that level yet.

              i got this:
              https://forums.modx.com/thread/50663/working-code-gallery-and-colorbox#dis-post-422895
              working for my page navigation through my structure....its EXACTLY the way i wanted it, but i cannot get it to translate to an aggregated front page section...