OK - I followed the instructions here:

http://drupal.org/node/44481

to get a customized view of the profile list - works very well.

The (testing) layout shows :

<div class="custom_profiles">
<div class="fields"><a href="/user/<?php print $user->uid; ?>"><?php print $user->profile_fullname ?></a></div>
<div class="fields"><a href="/profile/profile_group/<?php print $user->profile_group; ?>"><?php print $user->profile_group; ?></a></div>
</div>

Question 1 - is it possible to sort this list alphabetically by the profile field profile_fullname? By default it appears to be by reverse creation date.

Secondly - before I did this - the link to /profile/profile_group/ returned a list of all users with that value of profile_group - however - with the override in place I get nothing in the center (top, left and right bars and footer are there but nothing else).

Question 2 - how to get the group sorted list back working again ?

Comments

chrissearle’s picture

When I checked the .tpl.php file I found I had got:

<div class="fields"><a href="/profile/profile_group/ <?php print $user->group; ?> "> <?php print $user->profile_group; ?> </a></div>

where it should have been

<div class="fields"><a href="/profile/profile_group/ <?php print $user->profile_group; ?> "> <?php print $user->profile_group; ?> </a></div>

Still interested in an answer to q1 tho :)

lanesharon’s picture

I have a somewhat nicely formatted profile list:
http://gates-chili-high.org/profile

And have been able to categorize it down by year (and other elements):
http://gates-chili-high.org/profile/profile_grad_year/1961

But I sure would like to sort it by the profile_last_name field. Did you ever find an answer to your sorting dilemna? I could use a solution! Take Care, Sharon

chrissearle’s picture

Sadly still looking. Now I've got a second site that wants the same thing.

chrissearle’s picture

OK - the issue here is that I can't see a way to do this elegantly in the theme.

In the module file profile.module there is a function called profile_browse.

This has a large if statement. Search down to near the end of the function - there is an SQL call:

$result = pager_query("SELECT uid, access FROM {users} WHERE uid > 0 AND status != 0 ORDER BY access DESC", 20, 0, NULL);

So - the order on the user list page is based around access

I tried

$result = pager_query("SELECT uid, access FROM {users} WHERE uid > 0 AND status != 0 ORDER BY name ASC", 20, 0, NULL);

and I get my users in login name order.

You'd need to edit this query to join on the profile table and then sort on the field used in the profile for last name.

I guess that you might be able to override this in the theme (although I don't know) - but thats a large function and we only need to change one line. So - the quick hack is to edit direct (and - I'd really like to hear about better solutions :))