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

    MigX is really great to use, but I am having a little problem. I am using this call to getImageList:

    [[!getImageList?
    	&tvname=`curriculos`
    	&tpl=`curriculosTpl`
    	&sort`{"sortby":"nome","sortdir":"ASC"}`
    	&where=`{"especialidade:=":"Psiquiatria"}`
    	]]
    


    Everything is working fine, the filter is selecting, but I can't make the "sort" do it's job. What is wrong? Any idea?

    Here is my configuration: I am using Modx 2.2.4 and MIGX 2.1.1 and

    [{
    	"caption":"Curriculos",
    	"fields": [{
    		"field":"especialidade",
    		"caption":"Especialidade",
    		"inputTV":"fotosCV"
    	},{
    		"field":"nome",
    		"caption":"Nome"
    	},{
    		"field":"titulo",
    		"caption":"Título"
    	},{
    		"field":"texto",
    		"caption":"Texto",
    		"inputTV":"CVtexto"
    	},{
    		"field":"image",
    		"caption":"Foto",
    		"inputTV":"imageTV"
    	}]
    }]
    


    and

    [
    {"header": "Esp.", "width": "150", "sortable": "true", "dataIndex": "especialidade"},
    {"header": "Nome", "width": "150", "sortable": "true", "dataIndex": "nome"},
    {"header": "Titulo", "width": "100", "sortable": "true", "dataIndex": "titulo"},
    {"header": "Foto", "width": "70", "sortable": "false", "dataIndex": "image","renderer": "this.renderImage"}
    ]


    and

    <li>
    	<h3>[[+nome]] - [[+titulo]]</h3>
    	<img src="imagens/[[+image]]" alt="[[+nome]]">
    	[[+texto]]
    </li>
    


    Thanks in advance. [ed. note: sgobin last edited this post 11 years, 10 months ago.]
    • Maybe it's the difference between the words "nome" and "name"?

      You're sorting by name, but your field is named "nome".

      (I'm no expert with this, so I could be totally off base)
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 38500
        • 9 Posts
        @Frogabog Sorry, I misspelled it in the post, in the code everything is using the same word.
        • Ugh. That sucks. If only it could have been so easy, eh?
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster
            • 4172
            • 5,888 Posts
            perhaps its the missing '='

            &sort=`{"sortby":"nome","sortdir":"ASC"}`
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 38500
              • 9 Posts
              No, still not working.
                • 4172
                • 5,888 Posts
                with [] arround it?

                &sort=`[{"sortby":"nome","sortdir":"ASC"}]`
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 38500
                  • 9 Posts
                  Quote from: Bruno17 at Jun 27, 2012, 03:23 PM
                  with [] arround it?

                  &sort=`[{"sortby":"nome","sortdir":"ASC"}]`

                  Yes: the [ ] did the trick! Thanks.
                    • 38500
                    • 9 Posts
                    Just an update, I think it has to be with PHP version. It worked in PHP 5.3.6, but with PHP 5.3.3 I get the error:

                    Warning: Parameter 2 to array_multisort() expected to be a reference, value given in .../public_html/core/components/migx/model/migx/migx.class.php on line 1321
                      • 36686
                      • 165 Posts
                      Quote from: sgobin at Jul 12, 2012, 04:17 PM
                      Just an update, I think it has to be with PHP version. It worked in PHP 5.3.6, but with PHP 5.3.3 I get the error:

                      Warning: Parameter 2 to array_multisort() expected to be a reference, value given in .../public_html/core/components/migx/model/migx/migx.class.php on line 1321

                      Same here, I get the same error on my host with PHP 5.3.3. In my local development environment with PHP 5.4.10 the sorting works fine.