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

    in fact things are slightly more complicated than the thread title may suggest.

    In a resource, call it 'mother', there is a getResources call that pulls in two subresources, 'daughter1' and 'daughter2'. These two use a template to which a MIGX type TV is assigned (call it PF-Galerie). Through this TV, I add small series of images to the daughters, for a simple colorbox gallery. The contents of mother should consist, among other things, of the daughters' galleries, separated from each other.

    In the getResources template, PF1, there is a MIGX call to PF-Galerie, using a MIGX tpl called PF-Galerie. As you will know, here happens the image templating. Now in this tpl, PF-Galerie, I need to get the ID of the respective daughter, but
    [[*id]]
    gives me the ID of the mother.
    [[+id]]
    gives me nothing at all, and
    [[+idx]]
    gives me a numbering of the images.

    In fact I need to keep the galleries of the daughters apart. If I understood it right, Colorbox identifies galleries via the rel attribute. I plan to use the daughter ID for that task, adding it to the rel attribute, but I don't see how to get my hands on it.

    All contributions are appreciated! [ed. note: neo2.0 last edited this post 15 years, 1 month ago.]
      PHP illiterate MODx enthusiast
      • 36565
      • 73 Posts
      *bump* smiley
        PHP illiterate MODx enthusiast
        • 3749
        • 24,544 Posts
        I'm not sure I'm following you, but I think you'd have to move the idx tag outside the MIGX call if that's possible so it will be processed by getResources rather then MIGX.
          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
          • 36565
          • 73 Posts
          The problem is that I need to use the identifier generated by the tag inside the chunk that templates each image of each gallery. It looks like this:
          <a href="[[+bild]]" [[+_first:empty=`style="display:none"`]] class="zoom project_image"><img src="[[+bild]]" alt="" rel="colorbox[[*id]]" width="220px" height="150px"></a>

          So using the tag outside the chunk won't get me far. You will know that, but when you use colorbox in a page, it groups these images to a gallery that have the same rel value. I just need to cover that. Remember that I am aiming at generating several of these galleries in a page, using subresources for each gallery.
            PHP illiterate MODx enthusiast
            • 4172
            • 5,888 Posts
            the latest getImageList - snippet on github
            https://github.com/Bruno17/multiItemsGridTV/commit/de796eab0cb6e2b23921486be0ebb9e9542dba49

            does merge all scriptProperties to the placeholders.
            So you can do it like that now:

            [[getImageList? &resid=`[[+id]]` .............]]


            outputs the value of the property resid into the placeholder
            [[+property.resid]]


            hope this helps.

              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 36565
              • 73 Posts
              Yeah, that works! I am getting the desired values into the MIGX output.

              Alas, Colorbox isn't getting quite getting it, it seems to think that I am feeding it only one image in the group of five images, not showing the "next" button.

              But I'll try to work that out myself first.

              Thanks a lot!
                PHP illiterate MODx enthusiast
                • 36565
                • 73 Posts
                In case anyone is interested, the problem was that I had added the rel tag to the img tag, and not to the anchor tag, as I should have if I had followed the colorbox documentation.

                Everything is working great now.
                  PHP illiterate MODx enthusiast
                  • 37614
                  • 10 Posts
                  Good afternoon. I have a problem with the address of pictures. There is a folder, it is the conclusion of documents with pictures. The bottom line is that the image file name is displayed correctly, but the folder resource that creating with MIGX (tutorial http://rtfm.modx.com/display/ADDON/MIGX.Use+resource-specific+mediasource+and+multifile-uploader) why it is taken from the container.

                  Array
                  (
                      [MIGX_id] => 1
                      [image] => /assets/resourceimages/73/DSC_0121.JPG
                      [deleted] => 0
                      [_alt] => 0
                      [_first] => 1
                      [_last] => 1
                      [idx] => 1
                      [property.tvname] => resourcealbum
                      [property.docid] => 80
                      [property.limit] => 1
                  )
                  Array
                  (
                      [MIGX_id] => 6
                      [image] => /assets/resourceimages/73/214837-1680x1050.jpg
                      [deleted] => 0
                      [_alt] => 0
                      [_first] => 1
                      [_last] => 1
                      [idx] => 1
                      [property.tvname] => resourcealbum
                      [property.docid] => 78
                      [property.limit] => 1
                  )