We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6038
    • 228 Posts
    christianhanvey Reply #1, 18 years ago
    Im just getting into MODx and really enjoying it - but still not fully confident in how all the bits fit together, so i’m imagining this is actually a very simple question and would appreciate some help as to how it works! Heres my problem:

    I have a list of members for a site, who are all located in different regions.
    Regions are stored in the database in the ’modx_web_user_attributes_extended’ table under a ’region’ column with numerical values 1-5.
    I want public visitors to the site to be able to see what members are in the each region and for that i have created a map with clickable areas.
    I want to call the list, filtered by the region they have chosen when they click on the links in the map.

    Firstly, what do i put as my link to call the regions from this snippet?
    I’d like the map to display by default - when no region is requested - and the userlist to display when they click on the link
    I am using seo-friendly urls, so the page i have the map on is: http://site.com/map.html

    So should the link be something like http://site.com/map.html?region=2

    And how do i then get that value into the snippet call?
    Do snippets automatically look for values in a querystring?

    Heres an example of fixed snippet call that i am using:
    [!WebLoginPE? &type=`users` &usersList=`Members:default:default:surname:ASC:region(2)` !]
    Its the region filter at the end i want to change dynamically

    Thanks for any advice

    Environment:
    MODx 9.6.1
    PHP 5.2
    Apache 2
    Linux Server


      • 6038
      • 228 Posts
      christianhanvey Reply #2, 18 years ago
      errr... did i write the problem clearly enough?
      Still looking for help with this if anyone can spare a moment.
      ta
        • 4310
        • 2,310 Posts
        That’s odd I posted a reply and it’s gone.
        Use this snippet to retrieve the query string info.
        <?php
        $region = $_GET['region'];
        return $region;
        ?>

        Call the snippet in place of your number 2
          • 25483
          • 741 Posts
          ronaldlokers Reply #4, 18 years ago
          Quote from: bunk58 at Sep 25, 2008, 09:09 AM

          That’s odd I posted a reply and it’s gone.
          Use this snippet to retrieve the query string info.
          <?php
          $region = $_GET['region'];
          return $region;
          ?>

          Call the snippet in place of your number 2

          You should also give $region a standard number if there is no query or if the input is not a number wink
            with regards,

            Ronald Lokers
            'Front-end developer' @ h2o Media

            • 6038
            • 228 Posts
            thanks guys - i’m still learning how flexible this system is... its great!
            Im so used to NOT being able to manipulate a CMS, that its hard to break out of that mindset.