We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53460
    • 69 Posts
    No nothing. The o_id is for the old ID from our previous website.
      • 53460
      • 69 Posts
      Quote from: Bruno17 at Dec 16, 2017, 01:11 AM
      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`
      ]]
      

      Would it make sense to use an inline &tpl parameter? Then put the results in <option> tags?

      Something like &tpl=`<option>variable dump here</option>` ?

      I'm just not sure what placeholder to use inside it.
        • 4172
        • 5,888 Posts
        this snippet-call shows nothing? Do you see any items for Courts in the CMP (the Custom Manager Page)?
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 53460
          • 69 Posts
          Quote from: Bruno17 at Dec 16, 2017, 07:36 AM
          this snippet-call shows nothing? Do you see any items for Courts in the CMP (the Custom Manager Page)?

          I just added the snippet on the homepage to see what results it showed. This is what I got.

          Array
          (
              [id] => 1
              [o_id] => 8c31ee7a-e2b0-4608-9c23-fe19d3535f35
              [name] => Appellate Division, Third Department of the State of New York
              [_alt] => 0
              [_first] => 1
              [_last] => 
              [idx] => 1
              [property.packageName] => bir
              [property.classname] => birCourt
              [property.limit] => 10
          )
          Array
          (
              [id] => 2
              [o_id] => aefd5592-dd32-4eef-9b14-0e736aa2f80d
              [name] => Arkansas
              [_alt] => 1
              [_first] => 
              [_last] => 
              [idx] => 2
              [property.packageName] => bir
              [property.classname] => birCourt
              [property.limit] => 10
          )
          Array
          (
              [id] => 3
              [o_id] => 1a3451b8-18cd-43cf-9a5b-502ef7ee58ab
              [name] => California
              [_alt] => 0
              [_first] => 
              [_last] => 
              [idx] => 3
              [property.packageName] => bir
              [property.classname] => birCourt
              [property.limit] => 10
          )
          Array
          (
              [id] => 4
              [o_id] => 25f9a294-fe03-4d6f-86b6-e7dbe699e3e6
              [name] => Colorado
              [_alt] => 1
              [_first] => 
              [_last] => 
              [idx] => 4
              [property.packageName] => bir
              [property.classname] => birCourt
              [property.limit] => 10
          )
          Array
          (
              [id] => 5
              [o_id] => 736a6bb5-56f5-4d1c-9e71-b7dce98aaf42
              [name] => Colorado admission pending; currently admitted in Colorado for single client representation
              [_alt] => 0
              [_first] => 
              [_last] => 
              [idx] => 5
              [property.packageName] => bir
              [property.classname] => birCourt
              [property.limit] => 10
          )
          Array
          (
              [id] => 6
              [o_id] => d32a9cf7-cb3e-479b-abf4-e1ca05e8e042
              [name] => Connecticut
              [_alt] => 1
              [_first] => 
              [_last] => 
              [idx] => 6
              [property.packageName] => bir
              [property.classname] => birCourt
              [property.limit] => 10
          )
          Array
          (
              [id] => 7
              [o_id] => ba03a86b-f2fb-4215-852d-dcb7d31f9a19
              [name] => Court of Appeals of Maryland
              [_alt] => 0
              [_first] => 
              [_last] => 
              [idx] => 7
              [property.packageName] => bir
              [property.classname] => birCourt
              [property.limit] => 10
          )
          Array
          (
              [id] => 8
              [o_id] => 74625f34-82e3-493e-b9a1-0c30582e9cc5
              [name] => Delaware
              [_alt] => 1
              [_first] => 
              [_last] => 
              [idx] => 8
              [property.packageName] => bir
              [property.classname] => birCourt
              [property.limit] => 10
          )
          Array
          (
              [id] => 9
              [o_id] => 2cd64a97-acc7-4fb4-b47a-fbf453e805ad
              [name] => District of Columbia
              [_alt] => 0
              [_first] => 
              [_last] => 
              [idx] => 9
              [property.packageName] => bir
              [property.classname] => birCourt
              [property.limit] => 10
          )
          Array
          (
              [id] => 10
              [o_id] => 8f1f22df-4354-43b2-be97-b98744fbe1ea
              [name] => District of Columbia (application submitted)
              [_alt] => 1
              [_first] => 
              [_last] => 1
              [idx] => 10
              [property.packageName] => bir
              [property.classname] => birCourt
              [property.limit] => 10
          )
            • 53460
            • 69 Posts
            So this is where I'm at. I'm not sure where to go.

            [[migxLoopCollection?
               &classname=`birCourt`
               &limit=`5`
               &toJsonPlaceholder=`birCourtList`
            ]]
            


            I have the JSON outputting to this:
            [{
                "id": "1",
                "o_id": "8c31ee7a-e2b0-4608-9c23-fe19d3535f35",
                "name": "Appellate Division, Third Department of the State of New York"
            }, {
                "id": "2",
                "o_id": "aefd5592-dd32-4eef-9b14-0e736aa2f80d",
                "name": "Arkansas"
            }, {
                "id": "3",
                "o_id": "1a3451b8-18cd-43cf-9a5b-502ef7ee58ab",
                "name": "California"
            }, {
                "id": "4",
                "o_id": "25f9a294-fe03-4d6f-86b6-e7dbe699e3e6",
                "name": "Colorado"
            }, {
                "id": "5",
                "o_id": "736a6bb5-56f5-4d1c-9e71-b7dce98aaf42",
                "name": "Colorado admission pending; currently admitted in Colorado for single client representation"
            }]
            


            I just can't find a good way to parse this to just use the name and the id. I figured if I could get this translated to a list of items, then I could figure out how to output them for the dropdown list.
              • 4172
              • 5,888 Posts
              that's lookin good. Then try this:

              [[migxLoopCollection?
                 &packageName=`bir`
                 &classname=`birCourt`
                 &sortConfig=`[{"sortby":"name"}]`
                 &tpl=`@CODE:<option value="[[+id]]">[[+name]]</option>`
              ]]


              or put this in a chunk:
              <option value="[[+id]]">[[+name]]</option>


              and call it like that:

              [[migxLoopCollection?
                 &packageName=`bir`
                 &classname=`birCourt`
                 &sortConfig=`[{"sortby":"name"}]`
                 &tpl=`myChunk`
              ]]



                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 4172
                • 5,888 Posts
                the issue with your snippet was this:

                $where = array('active' => 1);
                


                Court doesn't have a active - field. But you don't need all this custom-snippets. Just use migxLoopCollection instead.
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 53460
                  • 69 Posts
                  Thanks Bruno! That worked to fill out the dropdown list. Now I just need to figure out how to make that filter the page content!