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

    I've made a simple portfolio website for myself. But have some problems.

    On the portfolio page (the root) I have a call like this:
    call:
    [[getResources? &parents=`[[*id]]` &tpl=`portfolio`]]



    This get the children of that page, witch are webdesign projects and put them in the portfolio tpl (chunk) like this:
    Portfolio Chunk/tpl:
    <li class="[[dynamicWidget]] [[*category]]">
    <a href="[[~[[+id]]]]">
    <!-- <img width="870" height="400" alt="[[+description]]" src="/images/foto1.png"></a> -->
    <img src="/images/foto3.png" alt="[[+description]]" />
    </li>



    It works, but how can i use the assigned gallery of the page and take the first picture to be displayed as a thumbnail?

    structure:
    [webdesign]
    + [project 1] - has a gallery assigned.
    + [project 2] - has a gallery assigned.

    I also want the projects in my sidebar widget, that looks trough the projects by picture and link, can i do this on the same way (i supposed).

    Maybe is the use of a gallery not the best solution, if you have a other solution, please explain it to me. thanks

    Live version:
    http://roywagemakers.nl/webdesign/
    The big numbers at the right are the projects with the thumbnail. in the left colomn you also see these projects.

    Could someone help me out? i could't find the right solution in the developer section of the wiki.
      Greatings,
      Roy Wagemakers
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Where's your reference to the gallery, a TV? Then use that TV value in a Gallery/GalleryItem snippet call to display it.

      Could also just store the images in a MIGX TV: https://www.markhamstra.com/modx-blog/2012/04/managing-galleries-with-migx/ or regular "image" TVs.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 22119
        • 22 Posts
        Quote from: markh at Feb 18, 2013, 09:59 AM
        Where's your reference to the gallery, a TV? Then use that TV value in a Gallery/GalleryItem snippet call to display it.

        Could also just store the images in a MIGX TV: https://www.markhamstra.com/modx-blog/2012/04/managing-galleries-with-migx/ or regular "image" TVs.

        yes, a tv with the value galleryalbumlist. but how to use this value in my chunk displayed above?

        edit: is this possible? [ed. note: oldvwmania last edited this post 13 years, 8 months ago.]
          Greatings,
          Roy Wagemakers
          • 22119
          • 22 Posts
          Quote from: oldvwmania at Feb 18, 2013, 11:41 AM
          Quote from: markh at Feb 18, 2013, 09:59 AM
          Where's your reference to the gallery, a TV? Then use that TV value in a Gallery/GalleryItem snippet call to display it.

          Could also just store the images in a MIGX TV: https://www.markhamstra.com/modx-blog/2012/04/managing-galleries-with-migx/ or regular "image" TVs.

          yes, a tv with the value galleryalbumlist. but how to use this value in my chunk displayed above?

          edit: is this possible?

          I've got this now:
          <li class="[[dynamicWidget]] [[*category]]">
             <a href="[[~[[+id]]]]">
                <img src="" alt="[[+description]]">[[*gallery]]
          [[!Gallery? &album=`quasi` &thumbProperties=`{"f":"jpg","q":"90%"}`]]
             </a>
          </li>


          but how to change the 'quasi' gallery with the actually gallery? the gallery assigned with the page we are referencing.


          testing out:
          <li class="[[dynamicWidget]] [[*category]]">
             <a href="[[~[[+id]]]]">
                [[!Gallery? &album=`[[~[[+gallery.name]]]]`]]
                <!--besch: [[+description]]-->
             </a>
          </li>


          give's the first gallery of the loop, i tought the [[~ ]] would gife me the right path, like the link in the code. but this doens't work. It feels like i'm almost there. what is the next step? [ed. note: oldvwmania last edited this post 13 years, 8 months ago.]
            Greatings,
            Roy Wagemakers
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            The [[~4]] syntax is only for resource URLs.

            The Gallery album list TV should return the album ID when referencing the template variable. You'll need to make sure getResources has &includeTVs=`1` and then use something along the lines of [[+tv.mytvname]] to get the album ID, and use that instead of "quasi" in your first example of your last post.
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 22119
              • 22 Posts
              Quote from: markh at Feb 18, 2013, 01:50 PM
              The [[~4]] syntax is only for resource URLs.

              The Gallery album list TV should return the album ID when referencing the template variable. You'll need to make sure getResources has &includeTVs=`1` and then use something along the lines of [[+tv.mytvname]] to get the album ID, and use that instead of "quasi" in your first example of your last post.
              Thanks; this was the right solution!

              my code:
              <li class="[[dynamicWidget]] [[+tv.category]]">
                 <a href="[[~[[+id]]]]" title="[[+description]]">
                    [[!Gallery? &album=`[[+tv.gallery]]` &limit=`1` &thumbWidth=`450` &thumbHeight=`450` &thumbZoomCrop=`2`]]
                 </a>
              </li>


              on more thing: this code generates some basic html like:
              <li class="background4 Responsive Design">
                 <a href="quasi.html" title="Ontwerp en implementatie van portfolio design">
                    <div class="gal-item-active">
                  <a href="webdesign/?galItem=1&galAlbum=1&galTag=" title="29639536-ae5f-4e1c-9ae0-7a98a1c2a2c7.jpg" >
              
                      <img class="" src="/assets/components/gallery/connector.php?action=web/phpthumb&w=450&h=450&zc=1&far=C&q=90&src=%2Fassets%2Fgallery%2F1%2F1.jpg" alt="29639536-ae5f-4e1c-9ae0-7a98a1c2a2c7.jpg"  />
                  </a>
              </div>
                 </a>
              </li>


              so I don't need this:
                    <div class="gal-item-active">
                  <a href="webdesign/?galItem=1&galAlbum=1&galTag=" title="29639536-ae5f-4e1c-9ae0-7a98a1c2a2c7.jpg" >
              
                      <img class="" src="/assets/components/gallery/connector.php?action=web/phpthumb&w=450&h=450&zc=1&far=C&q=90&src=%2Fassets%2Fgallery%2F1%2F1.jpg" alt="29639536-ae5f-4e1c-9ae0-7a98a1c2a2c7.jpg"  />
                  </a>
              </div>
              </li>


              but only:
              <img class="" src="/assets/components/gallery/connector.php?action=web/phpthumb&w=450&h=450&zc=1&far=C&q=90&src=%2Fassets%2Fgallery%2F1%2F1.jpg" alt="29639536-ae5f-4e1c-9ae0-7a98a1c2a2c7.jpg"  />


              but i don't need all of them, just the image. and also the link is referencing to the album not the page (like the quasi.html)
              How to do this?
                Greatings,
                Roy Wagemakers
                • 22119
                • 22 Posts
                could somebody tell me how to do this?
                  Greatings,
                  Roy Wagemakers
                  • 22119
                  • 22 Posts
                  Hello,

                  After a while i had time to rethink the code, so i came up with this:

                  [[GalleryItem? &id=`[[+tv.gallery]]` &toPlaceholders=`1`]]
                  <li class="[[dynamicWidget]] [[+tv.category]]">
                  [[!+galitem.image:notempty=`
                    <a href="[[~[[+id]]]]" title="[[+description]]">
                      <img src="[[+galitem.image]]" alt="[[+galitem.name]]" />
                    </a>
                  `]]
                  </li>


                  It works, but only the selected image is not the album's first item (tv.gallery) but the first or second image in that album.

                  So:
                  - i have 2 pages with each a gallery witht to images
                  - the code gives me the first album with picture 1 and picture 2.

                  How to solve this, please give me some advice because i really want this script to be finished. thanks wink
                    Greatings,
                    Roy Wagemakers