We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30912
    • 463 Posts
    Im a bit confused about the sort for getImageList, I havent in short been able to get it to work.

    In place is a MIGx which controls all of the adverts for the website, these can then be picked from a multiselect TV and outputted on the website using the following call:

    
    [[getImageList? &where=`{"title:in_array":"[[*RHS-Banner]]"}` &tvname=`RightBanners` &tpl=`AdvertDisplay` &docid=`203` ]]
    


    I wanted to sort by the input order of the TV [[*RHS-Banner]]

    so added this:

    
    [[getImageList? &where=`{"title:in_array":"[[*RHS-Banner]]"}` &tvname=`RightBanners` &tpl=`AdvertDisplay` &docid=`203` &sort=`[{"sortby":"title","sortdir":"ASC"}]`]]
    
    


    but the Order is still the same.

    Am i missing something, should i be sorting on the TV output, or MIGx_ID or something? These banners need to be in particular orders, but im at a loss as to how to get them to output in the order i want.

    thanks

      • 4172
      • 5,888 Posts
      &sort=`[{"sortby":"title","sortdir":"ASC"}]`
      


      this should work, but seems some php-versions have now issues with the sorting-function
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 30912
        • 463 Posts
        According to my hosting overview were on 5.3.3.
          • 20648
          • 26 Posts
          Hi,
          I have a similar challenge.

          I use migx for a listing of contactpersons
          In my tv ContactPersonList I have a list of all contactpersons.
          in my tv ChooseContactPersons the editor can choose which contactpersons to show. I use a multiselect listbox.

          In my template I have this call:
          [[getImageList? 
          &where=`{"name:in_array":"[[*ChooseContactPersons]]"}` 
          &tvname=`ContactPersonList` 
          &docid=`1` 
          &tpl=`@CODE:<address>  [[+company]] -   <strong>[[+name]]</strong> <br/>
            <abbr title="Phone">P:</abbr> [[+phone]]  <abbr title="E-mail">E:</abbr> <a href="mailto:[[+email]]">send e-mail</a></address>` 
            ]]
          



          Now I want to sort the contactperson in the selected order from my multiselect listbox.

          IE:
          this is what I select in the multiselect listbox:
          Contactperson1, Contactperson5, Contactperson4,Contactperson6

          If I use the &sort like this:
           &sort=`[{"sortby":"name","sortdir":"asc"}]`

          it will sort from the TV ContactPersonList and not from the Array order in the TV ChooseContactPersons.

          How can I get it to sort, from the selected order, in the multiselect listbox?

          Thanks in advance.