2

I'm trying to figure out how to have a page that lists all members with basic fields like email, screen_name and then all the other custom member fields I created.

2

Please see this thread: Display members in group in template

You will probably need to use an extension or plugin to do this easily. Something like solspace User or another plugin that will allow you to output your list directly.

Another option is accessing the member data via query but you will need to do some work to the query to get it to show the custom profile data. The standard query for members is:

{exp:query sql="SELECT * FROM exp_members"}

and if you need to group them by member group:

{exp:query sql="SELECT * FROM exp_members WHERE group_id='2'"} 

In this way you could get your member IDs and send them to an embedded template. Please note that it is probably more efficient to use a custom query instead of an embed.

{exp:query sql="SELECT member_id FROM exp_members"}
    {member_id}
    {embed="member-info-embed-template-path" member_id="{member_id}"}
{/exp:query}

then your embed template can output standard custom profile tags

{exp:member:custom_profile_data member_id="{embed:member_id}"}
    <div>{your_custom_profile_tag}</div>
{/exp:member:custom_profile_data}

For query speed with many members you will probably want to do away with the embed method and directly output all your member data via a custom query. You will need to do a JOIN for exp_members and exp_member_data based on the member id. I think the following will get you there.

{exp:query sql="SELECT * FROM exp_members INNER JOIN exp_member_data
ON exp_members.member_id = exp_member_data.member_id
GROUP BY exp_members.member_id
ORDER BY exp_members.member_id ASC
LIMIT 10"}
    {member_id} {screen_name} {m_field_id_2}<br />
{/exp:query}

you can adjust the above query as needed to limit your results by adding WHERE and AND clauses like WHERE group_id='4' AND m_field_id_2='whatever'

just keep in mind that you'll need to use m_field_id_NUMBER instead of the EE field name if you are using the above query as is. Also, it may be better to specify the exact column names in the SELECT rather than using SELECT *.

Hope this helps.

| improve this answer | |
  • great answer thank you. I've played with the exp:query so far and was trying to figure out to make a JOIN with all the custom member fields but got a little confused lol. Any idea how to make that one exp:query to have ALL member info? Amazes me how EE to this date doesn't have this basic information and some type of template tags to display member fields AND custom member fields! – Chief Feb 5 '17 at 15:00
  • I have over 2,000 members I will have to pull and create some filtering for... so whatever method is most efficient is what i want to use. your embed method seems pretty straight forward but is the exp:query combining member data AND custom member fields better solution? – Chief Feb 5 '17 at 15:03
  • 1
    btw, I'm already using "Smart Members" add-on for the importing features i needed, so using Solspace or another addon just to create this one member page isn't ideal. devot-ee.com/add-ons/smart-members-pro – Chief Feb 5 '17 at 15:06
  • added a custom query to my answer that should get you pointed in the right direction. Please let me know if I can help further. – pixldev Feb 6 '17 at 1:33
0

There is no need to fire custom queries for that. You can do it with any member module:

Free:

https://devot-ee.com/add-ons/zeal-smart-members

Paid:

https://devot-ee.com/add-ons/smart-members-pro

https://devot-ee.com/add-ons/user

You can search for other modules on https://devot-ee.com

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.