We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10071
    • 18 Posts
    I looking for a solution for my pictures collection.

    The situation is right now:

    SUbject 1 (has to filter all pictures for subject 1)
    Subject 2 (has to filter all pictures for subject 2)
    Subject 3 (has to filter all pictures for subject 3)
    Subject 4


    Pictures map -->2008-->
    2009-->Pictures about weather (subject 1)
    Pictures about whatever (subject 2)
    Pictures about whatever (subject 2)
    Pictures about subjes a (subject 3)

    I have a in the manager a directory where i save al my pictures divided in years.
    Now i want to load the pictures filtered in the front depended on subject.

    I have already made a TV to give each directory with pictures the right subject.
    Has somebody an idea how i can solve this problem?

      • 7923
      • 4,213 Posts
      You can use &view_gallery parameter to a gallery from another document. With &gal_query_ids you can show pictures from multiple galleries and with &pic_query_ids you can query certain pictures.

      If you need better "filtering", you could try something like this:

      Use a custom field to define the "subject" of the picture. Then create a snippet that finds picture id’s with certain subject and returns them comma separated. Then you can use something like this:

      [!MaxiGallery? &pic_query_ids=`[[GetPicturesBySubject? &subject=`A Subject`]]`!]

      Or take a look at this for help.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 10071
        • 18 Posts
        I have tried to get it work with xdbfilter, but it won’t do what it has to do.

        So i think the only solution is to make a snippet that looks for for alle galleries with the right subject.

        Example: Find under id83 all the child galleries with subject "flowers".

        How can i create that kind of snippet?
          • 4172
          • 5,888 Posts
          xdbfilter can do it for you!
          When you have a custom-field ’subject’ in your maxigallery-table

          you have three ways to do it with xdbfilter:

          1. with parameter in the snippet-call
          [[xdbfilter? &filters=`subject(flowers)` &tablename=`maxigallery`]]

          2. with GET-parameter in your Links [~yourID~]&filters=subject(flowers) with snippet-call
          [[xdbfilter? &tablename=`maxigallery`]]

          3. use the auto-created checkboxes for filtering with snippetcall
          [[xdbfilter? &refine=`1` &preselect=`` &filterOuterTpl=`filterOuterTpl` &filterTpl=`filterTpl`&filterItemTpl=`filterItemTpl` &filterFields=`subject` &showempty=`0` &tablename=`maxigallery`]] 


          xdbfilter then returns a placeholder [+imagelist+]
          so you can use it with [!maxigallery............&pic_query_ids=`[+imagelist+]`!]

          Two examples with checkboxes:
          http://www.meine-goldschmiede.de/index.php?id=10&filters=
          http://www.rgmarktheidenfeld.de/dragon/index.php?id=59&page=2&showempty=0&filters=Fotograf(Gudrun)||Kategorie(Sonstiges|Helfer)

          but it works also without the checkboxes

          Bruno
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 7923
            • 4,213 Posts
            @Bruno17,

            Have you thought of adding xdbfilter to modx resource repository?


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 4172
              • 5,888 Posts
              Hi doze,
              I think there is something todo before I can add this to the repository. I’m not really a coder and I’m thinking there are a lot of people who can make it much better than me.
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 7923
                • 4,213 Posts
                Well.. if it works, just add it.. It can always be updated if bugs are found. You can mark it as beta if you want.. I’m afraid that it will lost in the forums otherwise, I had trouble finding the thread already.

                You can even add it as a MaxiGallery addon if you like, but I have understood from your posts that it can be used with any db table as an utility snippet for something else, not just with MaxiGallery..

                In any case, I would suggest to put it in the repository and update later if needed.. There’s always more and more things you’d like to do to your code before releasing it to public and then again, you have less and less time and energy to do it, trust me. smiley


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 10071
                  • 18 Posts
                  Bruno, you are talking bout to add a custom field in the maxigallery table?

                  What do you mean with this?

                  - When i look at my database i have no table maxigallery.
                  - The maxi gallery doesn’t create a table either?

                  What do I have to do?
                    • 4172
                    • 5,888 Posts
                    you have to run maxigallery a first time to create the maxigallery-table in your database. For custom-fields you need the svn-version from here: http://mirror3.cvsdude.com/trac/doze/MaxiGallery/changeset/166/trunk/assets/snippets?old_path=%2F&format=zip

                    for creating custom-fields you need the parameter &customFields=`myfield1,myfield2,......` in your maxigallery-call
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 10071
                      • 18 Posts
                      I have installed the version the maxigallery you gave and i added the customfields.

                      I can find now the maxigallery table with the extra field "subject"
                      But all the fields are empty! What should be the way to fill "subject".

                      Do you have to that with manage pictures in the front, or only in phpmyadmin?

                      To create a child gallery my call looks likt this:

                      [!MaxiGallery? &display=`embedded` &embedtype=`lightboxv2` &pics_per_row=`2` &max_big_size=`450` &max_thumb_size=`240` &max_pic_size=`600` &pics_per_page=`20` &quality_thumb=`100` &customFields=`subject`!]

                      And the maxigallery call to look for all the child gallerys looks like this.

                      [!MaxiGallery? &display=`childgalleries` &childgalleryTpl=`child_gallery` &childgalleries_ids=`79`  !]

                      Do you see what i do wrong