We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44580
    • 189 Posts
    Quote from: gissirob at Oct 14, 2013, 05:34 AM
    Ok, I've managed to sort some of this out myself. The following foreach loop:

    foreach($users as $var => $value)
          {
          $profile = $modx->getObject('modUserProfile', $var);
          $v = $profile->get('fullname');
          } 

    successfully displays the last member of the group. What I need to do is:

    • return an array of all group members.
    • somehow get this array into a select list (preferably one that looks and acts like the Gender select on the new user page).
    I have no clue as to how to do this so help would again be much appreciated.

    Learning more all the time. The foreach code now looks like this:

                foreach($users as $var => $value)
                {
                $profile = $modx->getObject('modUserProfile', $var);
                $v .= '<option value="'.$var.'">'.$profile->get('fullname').'</option>';
                } 

    It still looks like crap on the page, but it is returning the array into a select list. On to the next challenge...
      • Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 44580
        • 189 Posts
        Thanks Susan. That makes sense on the front end where you want to be flexible. On the Manager side, I am trying to integrate it into the 'look and feel' of the manager template; that is I don't want it to be flexible - I want it to be the same. Does it still make sense to create a separate tpl under those circumstances?