3 Replies Latest reply on Mar 26, 2009 12:37 PM by Günter Schenk

    Sort Using URL Params?

    921creative Level 1
      I've seen websites that change the sorting order of a repeating region based on a URL parameter (ex. thispage.php?sort=state). I cannot for the life of me figure out how to do this with ADDT. Do you use multiple recordsets per page, each of which filter by a different URL variable? Or is it simply not possible with ADDT?
        • 1. Re: Sort Using URL Params?
          Waleed Barakat Level 1
          HI
          ----------
          Do you use multiple recordsets per page
          -----------
          No, but i think you have to add more extra field for the order as you required, then grasp it by request it from the recordset.
          __
          Best Regards
          Waleed Barakat
          Developer-Online Creator and programmer
          http://www.developer-online.com
          • 2. Re: Sort Using URL Params?
            Albert S. Level 3
            Hi AdobeBrian,

            ADDT Dynamic lists already have sorting features built into the list.

            Are you using a Dynamic list?
            • 3. Re: Sort Using URL Params?
              Günter Schenk Level 4
              Hi Brian,

              --------
              I've seen websites that change the sorting order of a repeating region based on a URL parameter (ex. thispage.php?sort=state). I cannot for the life of me figure out how to do this with ADDT
              --------

              You´ll basically need to turn the recordset´s static ORDER BY statement into a dynamic one, means something like:

              "SELECT * FROM tablename WHERE... ORDER BY ".$_GET['sort'].""

              This is of course a very basic example which assumes *that* thispage.php will always be referenced from e.g. another page that´s passing the URL parameter "sort" -- but in case thispage.php is supposed to additionally get loaded in a sort of stand-alone mode, you´ll need to implement a much more advanced PHP logic by basically defining an if/else condition which checks if the URL parameter "sort" is set or not, and turning the whole "ORDER BY whatever_condition" statement into a dynamic PHP component.

              ------
              Or is it simply not possible with ADDT?
              ------

              It requires manual PHP coding, and such a modified recordset will usually no longer be visible in DW´s server behaviours list

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver