We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53460
    • 69 Posts
    I have a website that was developed by a 3rd party that I've taken over. They set up a series of lists (presumably with MIGX) that are used for TV selections in people's profiles as well as filters on the parent page. http://bipc.morebipcinfo.com/people

    As you can see on this page, there is a filter for schools that works. I'm trying to duplicate that with the "admissions" filter. These lists are built via MIGX in a menu item in the back-end using a parameter (whereas "courts" are admissions):
    &configs=languages||schools||levels||courts||degrees||states||countries||eventtypes||newstypes


    In the template for the People page, the school dropdown is set up like this:
    <select name="school" id="schools" class="desktop-select">
       <option></option>
       [[getSchoolList]]
    </select>


    The getSchoolList snippet shows this:
    <?php
    global $modx;
    
    $serviceID = (string)$modx->getOption('serviceID', $scriptProperties, '');
    $type = (string)$modx->getOption('type', $scriptProperties, '');
    
    $where = array('active' => 1);
    $output = '';
    
    $query = $modx->newQuery('birSchool');
    $query->sortby('name','ASC');
    $query->where($where);
    $schools = $modx->getCollection('birSchool',$query);
    
    foreach ($schools as $school) {
      $output .= '<option value="'.$school->get('o_id').'">'.$school->get('name').'</option>';
    }  
    return $output;


    To be honest, I'm not exactly sure how this works. I've figured that 'birSchool' is the name of the schools list in MIGX. But I cannot find that to verify it. I've created a new snippet called [[getCourtList]] and changed the instances of schools to courts like this:
    <?php
    global $modx;
    
    $serviceID = (string)$modx->getOption('serviceID', $scriptProperties, '');
    $type = (string)$modx->getOption('type', $scriptProperties, '');
    
    $where = array('active' => 1);
    $output = '';
    
    $query = $modx->newQuery('birCourt');
    $query->sortby('name','ASC');
    $query->where($where);
    $courts = $modx->getCollection('birCourt', $query);
    
    foreach ($courts as $court) {
      $output .= '<option value="'.$court->get('o_id').'">'.$court->get('name').'</option>';
    }  
    return $output;


    Then added that to the people template too to get the dropdown list. Unfortunately, it's not pulling in any content and I'm out of ideas. Any suggestions would be appreciated.

    Thank you [ed. note: jeffsydor last edited this post 6 years, 4 months ago.]
      • 4172
      • 5,888 Posts
      could you show the xpdo-schema of the used package, please?
      And which version of MIGX and MODX are you at?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 53460
        • 69 Posts
        Quote from: Bruno17 at Dec 14, 2017, 09:09 PM
        could you show the xpdo-schema of the used package, please?
        And which version of MIGX and MODX are you at?

        Sorry, I don't know what the xpdo-schema is. Where can I find that?

        MODX: v2.5.1-pl
        MIGX: v2.9.6-pl
          • 4172
          • 5,888 Posts
          ok, we need to start at the basics.
          Could you export the configurations from the MIGX-CMP and post the export here?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 53460
            • 69 Posts
            Sorry, I've only been using MODX for about a year and your extra for less than that. Is this what you were looking for? I pulled these from: Extras > MIGX > MIGX (tab) > (Right-Click) Export Package

            thx
              • 4172
              • 5,888 Posts
              this is the right method to get the config, but could you please just post the code (in code-blocks) here?
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 53460
                • 69 Posts
                Sure thing. Thanks.

                {
                  "id":2,
                  "name":"Schools",
                  "formtabs":[
                    {
                      "MIGX_id":3,
                      "caption":"School",
                      "print_before_tabs":"0",
                      "fields":[
                        {
                          "MIGX_id":3,
                          "field":"name",
                          "caption":"Name",
                          "description":"School name",
                          "description_is_code":"0",
                          "inputTV":"",
                          "inputTVtype":"",
                          "validation":"",
                          "configs":"",
                          "restrictive_condition":"",
                          "display":"",
                          "sourceFrom":"config",
                          "sources":"",
                          "inputOptionValues":"",
                          "default":"",
                          "useDefaultIfEmpty":"0",
                          "pos":1
                        },
                        {
                          "MIGX_id":20,
                          "field":"o_id",
                          "caption":"Old ID",
                          "description":"can be created manually but will be generated automatically soon.Has to be unique!",
                          "description_is_code":"0",
                          "inputTV":"",
                          "inputTVtype":"",
                          "validation":"",
                          "configs":"",
                          "restrictive_condition":"",
                          "display":"none",
                          "sourceFrom":"config",
                          "sources":"",
                          "inputOptionValues":"",
                          "default":"",
                          "useDefaultIfEmpty":"0",
                          "pos":2
                        },
                        {
                          "MIGX_id":21,
                          "field":"active",
                          "caption":"Active?",
                          "description":"",
                          "description_is_code":"0",
                          "inputTV":"",
                          "inputTVtype":"listbox",
                          "validation":"",
                          "configs":"",
                          "restrictive_condition":"",
                          "display":"",
                          "sourceFrom":"config",
                          "sources":"",
                          "inputOptionValues":"Yes==1||No==0",
                          "default":1,
                          "useDefaultIfEmpty":"0",
                          "pos":3
                        }
                      ],
                      "pos":1
                    }
                  ],
                  "contextmenus":"update||duplicate||publish||unpublish||activate||deactivate||remove",
                  "actionbuttons":"addItem",
                  "columnbuttons":"update||duplicate||publish||unpublish||activate||deactivate||remove",
                  "filters":"",
                  "extended":{
                    "migx_add":"Add new school",
                    "disable_add_item":"",
                    "add_items_directly":"",
                    "formcaption":"",
                    "update_win_title":"",
                    "win_id":"school",
                    "maxRecords":"",
                    "addNewItemAt":"bottom",
                    "multiple_formtabs":"",
                    "multiple_formtabs_label":"",
                    "multiple_formtabs_field":"",
                    "multiple_formtabs_optionstext":"",
                    "multiple_formtabs_optionsvalue":"",
                    "actionbuttonsperrow":4,
                    "winbuttonslist":"",
                    "extrahandlers":"",
                    "filtersperrow":4,
                    "packageName":"bir",
                    "classname":"birSchool",
                    "task":"",
                    "getlistsort":"",
                    "getlistsortdir":"",
                    "sortconfig":"",
                    "gridpagesize":"",
                    "use_custom_prefix":"0",
                    "prefix":"",
                    "grid":"",
                    "gridload_mode":1,
                    "check_resid":1,
                    "check_resid_TV":"",
                    "join_alias":"",
                    "has_jointable":"yes",
                    "getlistwhere":"",
                    "joins":"",
                    "hooksnippets":{
                      "aftersave":"updateOldIDHook"
                    },
                    "cmpmaincaption":"Main caption",
                    "cmptabcaption":"Schools",
                    "cmptabdescription":"Manage Schools here",
                    "cmptabcontroller":"",
                    "winbuttons":"",
                    "onsubmitsuccess":"",
                    "submitparams":""
                  },
                  "columns":[
                    {
                      "MIGX_id":1,
                      "header":"ID",
                      "dataIndex":"id",
                      "width":20,
                      "sortable":"false",
                      "show_in_grid":1,
                      "customrenderer":"",
                      "renderer":"",
                      "clickaction":"",
                      "selectorconfig":"",
                      "renderchunktpl":"",
                      "renderoptions":"",
                      "editor":""
                    },
                    {
                      "MIGX_id":2,
                      "header":"Name",
                      "dataIndex":"name",
                      "width":200,
                      "sortable":true,
                      "show_in_grid":1,
                      "customrenderer":"",
                      "renderer":"",
                      "clickaction":"",
                      "selectorconfig":"",
                      "renderchunktpl":"",
                      "renderoptions":"",
                      "editor":""
                    },
                    {
                      "MIGX_id":3,
                      "header":"Old ID",
                      "dataIndex":"o_id",
                      "width":100,
                      "sortable":"false",
                      "show_in_grid":"0",
                      "customrenderer":"",
                      "renderer":"",
                      "clickaction":"",
                      "selectorconfig":"",
                      "renderchunktpl":"",
                      "renderoptions":"",
                      "editor":""
                    },
                    {
                      "MIGX_id":4,
                      "header":"Active",
                      "dataIndex":"active",
                      "width":"",
                      "sortable":"false",
                      "show_in_grid":1,
                      "customrenderer":"",
                      "renderer":"this.renderSwitchStatusOptions",
                      "clickaction":"switchOption",
                      "selectorconfig":"",
                      "renderchunktpl":"",
                      "renderoptions":[
                        {
                          "MIGX_id":1,
                          "name":"Active",
                          "use_as_fallback":"",
                          "value":1,
                          "clickaction":"",
                          "handler":"",
                          "image":"assets\/components\/migx\/style\/images\/tick.png"
                        },
                        {
                          "MIGX_id":2,
                          "name":"Not active",
                          "use_as_fallback":"",
                          "value":"0",
                          "clickaction":"",
                          "handler":"",
                          "image":"assets\/components\/migx\/style\/images\/cross.png"
                        }
                      ],
                      "editor":"this.listboxEditor"
                    }
                  ],
                  "createdby":1,
                  "createdon":"2016-12-04 10:20:10",
                  "editedby":1,
                  "editedon":"2017-03-22 14:31:22",
                  "deleted":0,
                  "deletedon":null,
                  "deletedby":0,
                  "published":1,
                  "publishedon":null,
                  "publishedby":0
                }


                {
                  "id":4,
                  "name":"Courts",
                  "formtabs":[
                    {
                      "MIGX_id":4,
                      "caption":"Court",
                      "print_before_tabs":"0",
                      "fields":[
                        {
                          "MIGX_id":4,
                          "field":"name",
                          "caption":"Court name",
                          "description":"",
                          "description_is_code":"0",
                          "inputTV":"",
                          "inputTVtype":"",
                          "validation":"",
                          "configs":"",
                          "restrictive_condition":"",
                          "display":"",
                          "sourceFrom":"config",
                          "sources":"",
                          "inputOptionValues":"",
                          "default":"",
                          "useDefaultIfEmpty":"0",
                          "pos":1
                        },
                        {
                          "MIGX_id":19,
                          "field":"o_id",
                          "caption":"Old ID",
                          "description":"should be added as now it's obligatory field",
                          "description_is_code":"0",
                          "inputTV":"",
                          "inputTVtype":"",
                          "validation":"",
                          "configs":"",
                          "restrictive_condition":"",
                          "display":"none",
                          "sourceFrom":"config",
                          "sources":"",
                          "inputOptionValues":"",
                          "default":"",
                          "useDefaultIfEmpty":"0",
                          "pos":2
                        }
                      ],
                      "pos":1
                    }
                  ],
                  "contextmenus":"update||duplicate||remove",
                  "actionbuttons":"addItem",
                  "columnbuttons":"update||duplicate||remove",
                  "filters":"",
                  "extended":{
                    "migx_add":"Add court item",
                    "disable_add_item":"",
                    "add_items_directly":"",
                    "formcaption":"",
                    "update_win_title":"",
                    "win_id":"",
                    "maxRecords":"",
                    "addNewItemAt":"bottom",
                    "multiple_formtabs":"",
                    "multiple_formtabs_label":"",
                    "multiple_formtabs_field":"",
                    "multiple_formtabs_optionstext":"",
                    "multiple_formtabs_optionsvalue":"",
                    "actionbuttonsperrow":4,
                    "winbuttonslist":"",
                    "extrahandlers":"",
                    "filtersperrow":4,
                    "packageName":"bir",
                    "classname":"birCourt",
                    "task":"",
                    "getlistsort":"",
                    "getlistsortdir":"",
                    "sortconfig":"",
                    "gridpagesize":"",
                    "use_custom_prefix":"0",
                    "prefix":"",
                    "grid":"",
                    "gridload_mode":1,
                    "check_resid":1,
                    "check_resid_TV":"",
                    "join_alias":"",
                    "has_jointable":"yes",
                    "getlistwhere":"",
                    "joins":"",
                    "hooksnippets":{
                      "aftersave":"updateOldIDHook"
                    },
                    "cmpmaincaption":"Main caption",
                    "cmptabcaption":"Courts",
                    "cmptabdescription":"Manage courts here",
                    "cmptabcontroller":"",
                    "winbuttons":"",
                    "onsubmitsuccess":"",
                    "submitparams":""
                  },
                  "columns":[
                    {
                      "MIGX_id":1,
                      "header":"ID",
                      "dataIndex":"id",
                      "width":15,
                      "sortable":true,
                      "show_in_grid":1,
                      "customrenderer":"",
                      "renderer":"",
                      "clickaction":"",
                      "selectorconfig":"",
                      "renderchunktpl":"",
                      "renderoptions":"",
                      "editor":""
                    },
                    {
                      "MIGX_id":2,
                      "header":"Court name",
                      "dataIndex":"name",
                      "width":"",
                      "sortable":true,
                      "show_in_grid":1,
                      "customrenderer":"",
                      "renderer":"",
                      "clickaction":"",
                      "selectorconfig":"",
                      "renderchunktpl":"",
                      "renderoptions":"",
                      "editor":""
                    },
                    {
                      "MIGX_id":3,
                      "header":"Old ID",
                      "dataIndex":"o_id",
                      "width":"",
                      "sortable":true,
                      "show_in_grid":"0",
                      "customrenderer":"",
                      "renderer":"",
                      "clickaction":"",
                      "selectorconfig":"",
                      "renderchunktpl":"",
                      "renderoptions":"",
                      "editor":""
                    }
                  ],
                  "createdby":1,
                  "createdon":"2016-12-04 15:17:07",
                  "editedby":1,
                  "editedon":"2017-03-22 14:27:57",
                  "deleted":0,
                  "deletedon":null,
                  "deletedby":0,
                  "published":1,
                  "publishedon":null,
                  "publishedby":0
                }
                  • 4172
                  • 5,888 Posts
                  I see, in both cases your packageName is: bir

                  "packageName":"bir",
                  


                  then you can find the xpdo-schema at core/components/bir/model/schema/

                  Or just go to the MIGX-CMP and put 'bir' into the packageName - field and Click 'Load Schema' at the XML Schema - tab

                  Then post that schema here, again
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 53460
                    • 69 Posts
                    Quote from: Bruno17 at Dec 15, 2017, 04:18 PM
                    I see, in both cases your packageName is: bir

                    "packageName":"bir",
                    


                    then you can find the xpdo-schema at core/components/bir/model/schema/

                    Or just go to the MIGX-CMP and put 'bir' into the packageName - field and Click 'Load Schema' at the XML Schema - tab

                    Then post that schema here, again

                    Thanks, I didn't know anything about that area. Here's what you were asking for:
                    <?xml version="1.0" encoding="UTF-8"?>
                    
                    <model package="bir" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
                        <object class="birLanguage" table="bir_language" extends="xPDOSimpleObject">
                    		<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
                            <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                        </object>
                    	<object class="birSchool" table="bir_school" extends="xPDOSimpleObject">
                    		<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
                            <field key="active" dbtype="tinyint" precision="1" phptype="boolean" attributes="unsigned" null="false" default="1">
                            <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                        </object>
                    <object class="birState" table="bir_state" extends="xPDOSimpleObject">
                    		<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
                    <field key="abbreviation" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="" />
                            <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                        </object>
                    <object class="birCountry" table="bir_country" extends="xPDOSimpleObject">
                    		<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
                    <field key="abbreviation" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="" />
                            <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                        </object>
                    	<object class="birLevel" table="bir_level" extends="xPDOSimpleObject">
                    		<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
                            <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                        </object>
                    <object class="birDegree" table="bir_degree" extends="xPDOSimpleObject">
                    		<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
                            <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                        </object>
                    	<object class="birEventType" table="bir_event_type" extends="xPDOSimpleObject">
                    		<field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
                            <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                        </object>
                    <object class="birNewsType" table="bir_news_type" extends="xPDOSimpleObject">
                            <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                        </object>
                        <object class="birCourt" table="bir_court" extends="xPDOSimpleObject">
                    <field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
                            <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default=""/>
                    <field key="o_id" dbtype="varchar" precision="255" attributes="unsigned" phptype="string" null="false" default="0" />
                        </object>
                    </model>
                      • 4172
                      • 5,888 Posts
                      I don't know, what the field o_id is for, but there is at least one mistake in the xpdo-schema.
                      there is o_id two times defined.

                      do you get anything with this snippet-call:

                      [[migxLoopCollection?
                      &packageName=`bir`
                      &classname=`birCourt`
                      &limit=`10`
                      ]]
                      
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!