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

    Having some problems displaying the gallery list of my galleries.
    I've used this tutorial (http://rtfm.modx.com/extras/revo/migx/migx.tutorials/migx.use-resource-specific-mediasource-and-multifile-uploader) to do a gallery.
    I need to list all galleries in my gallery, but when I do, it only give one child image and all other replace whit the ID of the parrent.

    here's my getResources call :
    [[!getResources?
    	&tpl=`gallery.gallery.tpl`
    	&sortby=`menuindex`
    	&sortdir=`DESC`
    	&limit=`0`
    	&depth=`2`
    	&showHidden=`1` 
    	&includeContent=`1` 
    	&includeTVs=`1` 
    	&processTVs=`1` 
    	&tvPrefix=``
    ]]



    here's my gallery.gallery.tpl
    [[!getImageList? 
    	&tvname=`resourcealbum` 
    	&tpl=`photoGalleryGallery.tpl`
    	&limit=`1`
    	&where=`{"published":"1"}`
    	&docid=`[[+id]]`
    	&pagetitle=`[[+pagetitle]]`
    	¤tID=`[[+id]]`
    ]]


    here's my photoGalleryGallery.tpl:
    					<div class="col-md-4" data-animated="0">
    						<h5><a href="[[~[[+property.currentID]]]]">[[+property.pagetitle]]</a></h5>
    								<div class="mp-thumb">
    									<a href="[[~[[+property.originalResourceId]]]]"><img src="[[+image:phpthumbof=`w=200&h=113&zc=1&q=30`]]" class="img-responsive" alt="[[+property.pagetitle]]"/></a>
    										<span class="prettyPhoto zoom"><i class="fa fa-share-square"></i></span>
    								</div>
    								<p><em>Afficher la gallerie</em></p>
    								<div style="background: pink;">
    									currentID : [[+property.currentID]] <br />
    									id : [[+id]]
    								</div>
    
    							</div>



    • the [[+id]] and [[+property.currentID]] both points the to correct ID;
    • the [[+image]] give's me the correct image name but it give me the parent ID in the path

    For example:
    let's says the child gallery is ID 51 and parent ID is 603, image name is MyImage.jpg: with those piece of code the output I get is:

    currentID = 51

    id = 51

    image path : /assets/images/603/MyImage.jpg.

    seems I can't figure that out, thanks for the help.

    This question has been answered by Bruno17. See the first response.

    [ed. note: Egam last edited this post 11 years, 3 months ago.]
    • discuss.answer
      • 4172
      • 5,888 Posts
      seems, setting the placeholder 'docid' for the mediasource seems not to work in that case, as it should.
      I see also no reason to call everthing uncached here.
      So try it this way:

      [[getResources?
          &tpl=`gallery.gallery.tpl`
          &sortby=`menuindex`
          &sortdir=`DESC`
          &limit=`0`
          &depth=`2`
          &showHidden=`1` 
          &includeTVs=`1` 
          &tvPrefix=``
      ]]


      [[getImageList? 
          &tvname=`resourcealbum` 
          &tpl=`photoGalleryGallery.tpl`
          &limit=`1`
          &where=`{"published":"1"}`
          &docid=`[[+id]]`
          &pagetitle=`[[+pagetitle]]`
          &processTVs=`0`
      ]]


      <div class="col-md-4" data-animated="0">
          <h5><a href="[[~[[+property.docid]]]]">[[+property.pagetitle]]</a></h5>
                  <div class="mp-thumb">
                      <a href="[[~[[+property.docid]]]]">
                      <img src="[[phpthumbof? &input=`/assets/images/[[+property.docid]]/[[+image]]` &options=`w=200&h=113&zc=1&q=30`]]" class="img-responsive" alt="[[+property.pagetitle]]"/></a>
                          <span class="prettyPhoto zoom"><i class="fa fa-share-square"></i></span>
                  </div>
                  <p><em>Afficher la gallerie</em></p>
                  <div style="background: pink;">
                      currentID : [[+property.currentID]] <br />
                      id : [[+id]]
                  </div>
       
              </div>
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 8548
        • 104 Posts
        Bruno, once again, you fixed my problem.

        [[phpthumbof? &input=`/assets/images/[[+property.docid]]/[[+image]]` &options=`w=200&h=113&zc=1&q=30`]]

        was the main part of the fix.

        thank you so very much.