We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    Hello,
    I did make some modifications to maxigallery for me. Now i have customfields and can filter the pictures with checkboxes. You can change the look of the filtercheckboxes with templates. The Checkboxes then are generatet from the script. You can set the filters with the url-link, a snippet-parameter or with the checkboxes in the filter-form.
    New parameters:

    • &customfields - to generate the custom fields
    • &filterFields=`steinbesatz,title` - to generate the needed checkboxes in the filterform
    • &filters=`steinbesatz(Brillant|Citrin)||title(ring)` - to filter the picures with parameter
    • &display=`filter` - to show not the gallery, but the filterform(it calls a own script)
    • &filterOuterTpl=`filterOuterTpl`

    • &filterTpl=`filterTpl`
    • &filterItemTpl=`filterItemTpl`
    • and some new placeholters for the new templates
    Example-snippetcall for the filterform:
    [!MaxiGallery? &display=`filter` &filterOuterTpl=`filterOuterTpl` &filterTpl=`filterTpl`&filterItemTpl=`filterItemTpl` &filterFields=`steinbesatz,title`  !] 

    Example-snippetcall for the maxigallery
    [!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &customFields=`steinbesatz` &filters=`steinbesatz(Brillant|Citrin)||title(ring)` &filterFields=`steinbesatz,title` !]

    Perhaps is somebody interested to the new functions. I am not a programmer and it would be good if you can have a look to the code. Can I post my changes anywhere?
    To see it in action click here
    Testlink

    sorry for my bad english
    regards
    Bruno
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 36624
      • 535 Posts
      looks wonderful bruno !
        CTRL+SHIFT+U - Clear Cache
        CTRL+SHIFT+H - Hiding Heft Panel
        CTRL+SHIFT+N - Fast Create Resource
        CTRL+ALT+P - Preview Recource (in edit resorce window)
        CTRL+ALT+S - Save
        • 27889
        • 415 Posts
        thank you for sharing,
        but I think hack are not very easy to upgrade with new version of snippet, to do the same kind of result I have made a snippet, wich retrive the filtered documents’ ids I put in the maxigallery call for the &galid parameter.

        Perhaps it will be a better way for you.
          MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
          MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
          • 4172
          • 5,888 Posts
          Hello Soda,
          thanks for reply!
          I am interested on this snippet, how can I get this one?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 27889
            • 415 Posts
            The call:
            [!MaxiGallery? &pic_query_ids=`[[searchGallery]]` &display=`embedded` &embedtype=`slimbox` &pics_per_row=`3` &clearerTpl=`
            ` &galleryPictureTpl=`GalInnerTplSearch` &galleryOuterTpl=`galleryOuterTplVille` &css=`/css/galeriecss.css`!]

            Here some piece of code you need to accomodate to your needs, it’s a search engine for image with AjaxSearch.

            <?php
            $word=($_POST['search'])?$_POST['search']:$_GET['AS_search'];
            $word=$_POST['search'];
            if ($word){
            $word=$_POST['search'];
            $limit=isset($limit)?$limit:40; // max how many pics to work with
            $display=isset($display)?$display:10; //the number of pics to display
            $random=isset($random)?$random:1;  //randomize pics
            
            $path_to_galleries=$modx->config['site_url']."assets/galleries/";
            
            $table = $modx->getFullTableName("maxigallery");
            $rs = $modx->db->select("*", $table, "title like '%".$word."%'"); // here is the filter you can modify
            $pics = array();
            while ($row = $modx->db->getRow($rs)) {
            	 array_push($pics, $row);
            }
            
            foreach ($pics as $pic){
            	$listpicid.=$pic['id'].',';
            }
            $listpicid= preg_replace('/,$/','',$listpicid);
            $modx->setPlaceholder('listid', $listid);
            echo "$listpicid";
            }
            ?>
            
              MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
              MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
              • 4172
              • 5,888 Posts
              Soda,
              thank you very much!! I would try this way, it looks very good. But what with the customfields and its placeholders, i think this modification I did is a must to have.
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 7923
                • 4,213 Posts
                Looks good.. post the code here Bruno17 and it might find it’s way to the next version..


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 4172
                  • 5,888 Posts
                  Here are the files with modifications for custom-fields
                  and the files for filter functionality as one zip-file

                  [Edit]
                  Now the filter functions are standalone and you can use it for every database-table or query.
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 4172
                    • 5,888 Posts
                    Now you can set &pic_query_ids=`[+imagelist+]` for the manager too.
                    All the functionality is now in one script named maxifilter which generates all the placeholders and formfields to filter the pictures from maxigallery.
                    a new parameter for maxifilter:
                    &showempty=`showemptyfields` - shows a checkbox with the label of the parametervalue. When you check this one, maxigallery shows all pictures where the field is empty.
                    You can find here a http://www.meine-goldschmiede.de/index.php?id=10&showempty=wenn%20leer&filters=
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 4172
                      • 5,888 Posts
                      In slimbox I have now the custom-fields from a hidden div in gallerypicturetpl, xdbfilter is now standalone and you can use the filter for all database-tables or querys in modx.
                      Example: site-content for the parameter &documents in Ditto.
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!