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

    So im following the steps to setup a drop down MIGx filter from http://rtfm.modx.com/extras/revo/migxdb/migxdb.tutorials/migxdb.manage-child-resources-in-a-grid-tv-with-help-of-migxdb Which are

    Dropdown Filter for filtering by categories

    filter Name: category
    label: category
    empty text: - category filter -
    filter type: combobox
    getlist-where:

    tvFilter::categories=inArray=[[+category]]

    getcombo processor: getTVcombo
    getcombo textfield: categories (this is used in our getTVcombo-processor to get the input-options of the TV 'categories' for our filter-dropdown)

    Save them all with clicking 'Done' on all windows

    Now you should be able to filter the child-resources by searching and/or choosing a category

    But So far i havent gotit to work i have the following:

    filter Name: type
    label: Type
    empty text: - Type filter -
    filter type: combobox
    getlist-where:

    tvFilter::res_Type=inArray=[[+type]] (res_Type is my TV_

    getcombo processor: getTVcombo
    getcombo textfield: type

    But it doesnt work, am i missing something and being dense?
      • 4172
      • 5,888 Posts
      which part doesn't work?

      Getting the list of categories into the listbox or filtering the resources?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 30912
        • 463 Posts
        getting the list of categories - sorry Bruno - it was late and i was getting frustrated
          • 4172
          • 5,888 Posts
          try:

          getcombo textfield: res_Type


          and there is a new package for that tutorial:
          https://github.com/Bruno17/migxchildresources/tree/master/packages
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 30912
            • 463 Posts
            No luck on that - even with the package installed.

              • 4172
              • 5,888 Posts
              hmm... I've created this TV with some input-option-values and its working for me.

              you may need to debug the getTVcombo - processor.

              quick and dirty:

              <?php
              
              //if (!$modx->hasPermission('quip.thread_list')) return $modx->error->failure($modx->lexicon('access_denied'));
              
              $config = $modx->migx->customconfigs;
              
              echo $tvname = $config['gridfilters'][$scriptProperties['searchname']]['combotextfield'];
              
              echo '<br />';
              
              $rows = array();
              if ($tv = $modx->getObject('modTemplateVar', array('name' => $tvname))) {
                  $options = $tv->parseInputOptions($tv->processBindings($tv->get('elements')));
                  
                  print_r($options);
                  
                  foreach ($options as $option){
                      $option = explode('==',$option);
                      $opt['combo_id'] = $option[0];
                      $opt['combo_name'] = isset($option[1]) ? $option[1] : $option[0];
                      $rows[] = $opt;
                  }
              }
              
              print_r($rows);
              
              $emtpytext = $config['gridfilters'][$scriptProperties['searchname']]['emptytext'];
              $emtpytext = empty($emtpytext) ? 'all' : $emtpytext;
              
              $rows = array_merge(array(array('combo_id' => 'all', 'combo_name' => $emtpytext)), $rows);
              
              return $this->outputArray($rows, $count);
              
              


              see the response with firebug.
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 30912
                • 463 Posts
                Thansk Bruno, i'l look at it later its not imperitive but it would be a nice to have at this point.

                Ill setup the processor above later adn see what come sup.

                thanks

                  • 54063
                  • 14 Posts
                  I'm also struggling to get the filters to work. Its outputting correctly in the dropdown in my CMP but when I click to filter its returning nothing. My TV is single select called 'status'.

                  Filter name:
                  statuses

                  Label:
                  status

                  Empty Text:
                  -- Filter Status --

                  Filter Type:
                  combobox

                  getlist-where:
                  tvFilter::status=[[+statuses]]

                  getcombo processor:
                  getTVcombo

                  getcombo textfield:
                  status

                  Any help appreciated!! [ed. note: sparker last edited this post 6 years, 2 months ago.]
                    • 54063
                    • 14 Posts
                    Can anyone help at all? I'm really struggling to figure this one out and I'm sure its something simple I'm missing where I'm typing the getlist-where.

                    Thanks,
                      • 17301
                      • 932 Posts
                      Try
                      tvFilter::status==[[+statuses]]
                        ■ email: [email protected] | ■ website: https://alienbuild.uk

                        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.