We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37242 ☆ A M B ☆
    • 339 Posts
    Hi everyone,

    a am currently setting up a website where I use getResources and Gallery. I have people which have galleries (no users, i just put them there). Every "People" has TV (from Gallery) and I gave them a TV like "GalleryID".

    On the "People" page, I have this (single people are on the next level):

    <div class="list-docs thumb grid">
     [[!getResources?  
        &parents=`[[*id]]`
        &tpl=`peopleGridItem`
        &sortdir=`ASC`  
        &includeTVs=`1`
        &processTVs=`1`
        &includeContent=`1`   
        &depth=`0`
        &sortby=`menuindex`
        ]]  
    </div>


    and that peopleGridItem chunk:
    <div class="list-item column span-6">
          <h2>[[+pagetitle]]</h2>
             <a href="[[~[[+id]]]]" title="[[+pagetitle]]">   
    [[*galleryitem]]
             </a>
        <p>[[+introtext]]</p>
    </div>


    I tried setting the output type of galleryitem to "image" and anything else, I get no image out of it. The current output is
    {"gal_src":false}

    If I use something this
    [[Gallery? &album=`[[+tv.AlbumId]]` &useCss=`0` &containerTpl=`MediaPreviewAlbumTpl` &thumbWidth=`195` &thumbHeight=`140` &thumbTpl=`MediaPreviewItemThumb` &limit=`1`]]

    I only get links to the gallery, not to the persons page.

    If anyone has a clue - I would be glad smiley

    Cheers,

    Guido
      • 37242 ☆ A M B ☆
      • 339 Posts
      Ok. I edited all the template chunks and have now a get resources:

      <div id="banners">
      <div class="wrapper pad_bot1">
      [[!getResources?  
          &parents=`8` 
          &tpl=`peopleRowTpl`  
          &limit=`3`  
          &sortdir=`ASC`  
          &includeTVs=`1` 
          &depth=`0`  
          &sortby=`menuindex`  
      ]]
      </div>
      </div>


      which calls this template chunk

      [[!Gallery? &limit=`1` &album=`[[+tv.gpgf]]` &toPlaceholder=`galleryimage` &thumbTpl=`thumbTpl` &thumbWidth=`248` &thumbHeight=`324`]]
      
      <a class="marg_right1" href="[[~[[+id]]]]" title="[[+pagetitle]]">
      <img src="[[+galleryimage]]" alt="[[+pagetitle]]" />
      <span class="font2 sg">[[+pagetitle]]</span>
      </a>


      with the following code as thumbTpl:
      [[+thumbnail]]


      I get the same images for all peolpe. Do I have to reset the gallery betweendifferent people - and how?
        • 37242 ☆ A M B ☆
        • 339 Posts
        How do I prevent a chunk from beeing cached?
          • 37242 ☆ A M B ☆
          • 339 Posts
          Solution:

          extend the placeholder name by a specific tv value [[!+tv.gpgf]] in this case:

          <!-- Hier: getAlbum --//>
          [[!Gallery? &limit=`1` &album=`[[!+tv.gpgf]]` &toPlaceholder=`galleryimage[[!+tv.gpgf]]` &thumbTpl=`thumbTpl` &thumbWidth=`248` &thumbHeight=`324`]]
          
          <a class="marg_right1" href="[[~[[+id]]]]" title="[[+pagetitle]]">
          <img src="[[!+galleryimage[[!+tv.gpgf]]]]" alt="[[+pagetitle]]" />
          <span class="font2 sg">[[+pagetitle]]</span>
          </a>
            • 34035
            • 2 Posts
            Thanks, dogo!
            This works fine on MODX 2.0.8-pl
            On 2.2.2-pl i have one problem - for first item chunk works fine. But for second item image URL is not showing. All another variables (pagetitle, url) is showing correctly.
               [[!getResources?  
                &parents=`[[*id]]` 
                &tpl=`CatalogItemTpl`  
                &limit=`5`  
                &sortdir=`ASC`  
                &includeTVs=`1`  
                &includeContent=`1`  
                &processTVs=`1` 
                &depth=`0`  
                &sortby=`menuindex`  									
                ]] 

            CatalogItemTpl:
            <div class="block">
            	<figure>
            	 
            [[!Gallery? &limit=`1` &album=`[[!+tv.albom]]` &toPlaceholder=`galleryimage[[!+tv.albom]]` &thumbTpl=`thumbTpl` &thumbWidth=`183` &thumbHeight=`135`]]
            <a href="[[~[[+id]]]]" title="[[+longtitle]]"><img src="[[!+galleryimage[[!+tv.albom]]]]" alt="[[+pagetitle]]" Width="183" Height="135" /></a>  
            	  
            		<h3><a href="[[~[[+id]]]]" title="[[+pagetitle]]">[[+pagetitle]]</a></h3>
            	</figure>
            </div>
            [ed. note: eevgeny last edited this post 14 years, 4 months ago.]
              • 34035
              • 2 Posts
              I have no problem on MODX 2.0.8-pl and Gallery 1.4.0 rc1
              And there is a problem on MODX 2.2.2-pl with Gallery version 1.5.0 rc1.

              Is this problem in update?
                • 38222
                • 2 Posts
                After update gallery to 1.5.2 there is a new errors:

                Warning: Invalid argument supplied for foreach() in /var/www/jjek/data/www/vertical.ru/core/cache/includes/elements/modsnippet/14.include.cache.php on line 106

                Fatal error: Cannot use string offset as an array in /var/www/jjek/data/www/vertical.ru/core/cache/includes/elements/modsnippet/14.include.cache.php on line 157 [ed. note: fotowell last edited this post 14 years, 3 months ago.]