Display member list?
Permalink
Hello.
I recently discovered C5 and find it thoroughly amazing. I have already begun porting a Joomla site I currently maintain to C5 and it's going great. But I have one problem.
The site is for a preschool, and one of the sub-pages is supposed to contain a list of the staff, preferably with thumbnails/avatars, job position and email.
In Joomla I could simply have a page that displayed all contacts within a specific group, and then add and remove users for staff as they joined or quit.
This seems to be just about the only thing Joomla does better than C5, because this doesn't seem to be possible in C5. While I can create a user for each staff member, and add to a group, say "Staff", there doesn't seem to be any block or list or whatever to simply display all members of group X. I've searched the add-ons and Googled to no avail. All I found was a thread here that suggested that this could be hacked in with some PHP by directly accessing the UserInfo objects, but I'd rather have a cleaner solution than that.
Is this possible, or do I have to manually build a table with the attributes I want in PHP?
I recently discovered C5 and find it thoroughly amazing. I have already begun porting a Joomla site I currently maintain to C5 and it's going great. But I have one problem.
The site is for a preschool, and one of the sub-pages is supposed to contain a list of the staff, preferably with thumbnails/avatars, job position and email.
In Joomla I could simply have a page that displayed all contacts within a specific group, and then add and remove users for staff as they joined or quit.
This seems to be just about the only thing Joomla does better than C5, because this doesn't seem to be possible in C5. While I can create a user for each staff member, and add to a group, say "Staff", there doesn't seem to be any block or list or whatever to simply display all members of group X. I've searched the add-ons and Googled to no avail. All I found was a thread here that suggested that this could be hacked in with some PHP by directly accessing the UserInfo objects, but I'd rather have a cleaner solution than that.
Is this possible, or do I have to manually build a table with the attributes I want in PHP?
Thanks for the reply, it's very helpful.
I'm still having some problems though. Just adding the line to the members.php in /controllers/ triggers the following output at the top of the members page:
(mysql): SELECT DISTINCT u.uID, u.uName FROM Users u left join UserGroups ug_3 on ug_3.uID = u.uID left join UserSearchIndexAttributes on (UserSearchIndexAttributes.uID = u.uID) where 1=1 and ug_3.gID=3 and u.uIsActive = '1' and u.uIsValidated != '0' order by uName asc limit 0,10
Warning: Cannot modify header information - headers already sent by (output started at /[site_root]/concrete/libraries/3rdparty/adodb/adodb.inc.php:483) in /[site_root]/concrete/libraries/view.php on line 758.
Otherwise the list renders fine, just needs some fine tuning (remove the search box, etc). I checked the members.php for spacing errors before or after the <?php ... ?> but that didn't help.
On top of that I'm also having some problems understanding how the single pages work overall. I get how I edit them, and how I add new pages in the dashboard, but I'm still a little lost on how to actually link to a single page like this on my site. I can't choose it in the New Page dialog, I can't create it directly in the Sitemap, all I can do is open it directly from the Dashboard in the list of single pages.
I'm obviously misunderstanding something here, can you shed some light on this for me?
I'm still having some problems though. Just adding the
$userList->filterByGroup('groupname');
(mysql): SELECT DISTINCT u.uID, u.uName FROM Users u left join UserGroups ug_3 on ug_3.uID = u.uID left join UserSearchIndexAttributes on (UserSearchIndexAttributes.uID = u.uID) where 1=1 and ug_3.gID=3 and u.uIsActive = '1' and u.uIsValidated != '0' order by uName asc limit 0,10
Warning: Cannot modify header information - headers already sent by (output started at /[site_root]/concrete/libraries/3rdparty/adodb/adodb.inc.php:483) in /[site_root]/concrete/libraries/view.php on line 758.
Otherwise the list renders fine, just needs some fine tuning (remove the search box, etc). I checked the members.php for spacing errors before or after the <?php ... ?> but that didn't help.
On top of that I'm also having some problems understanding how the single pages work overall. I get how I edit them, and how I add new pages in the dashboard, but I'm still a little lost on how to actually link to a single page like this on my site. I can't choose it in the New Page dialog, I can't create it directly in the Sitemap, all I can do is open it directly from the Dashboard in the list of single pages.
I'm obviously misunderstanding something here, can you shed some light on this for me?
Did you check out the docs?
http://www.concrete5.org/documentation/developers/pages/single-page...
They are basically one-off pages that have a view and a controller. You add them by path in the dashboard and that essentially give them a page record in concrete5. Once they have that record, they appear in the sitemap.
The outputting of the query is strange, I'll take a peak at that.
You could also try:
those function names may not be exactly right... fyi
Also check out this doc page:
http://www.concrete5.org/documentation/developers/permissions/user-...
http://www.concrete5.org/documentation/developers/pages/single-page...
They are basically one-off pages that have a view and a controller. You add them by path in the dashboard and that essentially give them a page record in concrete5. Once they have that record, they appear in the sitemap.
The outputting of the query is strange, I'll take a peak at that.
You could also try:
$g = Group::getByName('groupname'); $userList->filterByGroupID($g->getGroupID());
those function names may not be exactly right... fyi
Also check out this doc page:
http://www.concrete5.org/documentation/developers/permissions/user-...
Thanks. I read the documentation on single pages but might have skimmed the part about actually getting them in the sitemap. Will read again.
And will try referring to the group ID instead of name, see how that will work.
Edit: Yes, that did indeed solve the problem. I can't say I understand why, but it did. Now to understand the single page thing better.
Thanks for the help!
And will try referring to the group ID instead of name, see how that will work.
Edit: Yes, that did indeed solve the problem. I can't say I understand why, but it did. Now to understand the single page thing better.
Thanks for the help!
Try running that query directly in your db, see if it errors..
I also filter members by groupname and just rolled my code to 5.4. With 5.4, I was also getting an sql statement dumped out so I looked at concrete/models/user_list.php and found that there was a debug() statement left in the function filterByGroup. Looks like it was probably accidentally left in there. I commented it out and now all is good. Are you trying this on 5.4?
thanks for pointing out the debug() statement in there...that sql dump had me totally confused.
/concrete/single_pages/members.php
/concrete/controllers/members.php
You can take those and use them as a starting point by copying them outside of the concrete directory to:
/single_pages/
/controllers/
Then modify the controller's view function:
and add: