XF 2.0 Display Users and Usergroups in template - XF2

Idris_

Member
Hi, I'm trying to display some users and some members of particular users groups in a page template.

I've got a page and what I'm trying to do is simply show a roster type list of users from different user groups.


Kind Regards,
Idris.
 
You can use Users > Member Statistics to display any user group in the members page. It works well if you just need a roster displaying groups and the members within that group.
 
Hi I'm just trying to basically make a roster system (yes I've seen the roster system for XF2 since I'm looking to only use one feature of it, $25 is a bit steep for what I need) I was hoping to make something like:

HTML:
h1 - Administrators
<for user in users>
    <if $user=="administrator">
        <$avatar>
        <$username>
    <endif>
<endfor>

h1 - Moderators
<for user in users>
    <if $user=="Moderator">
        <$avatar>
        <$username>
    <endif>
<endfor>

Edit 1: Is there a location I can find where to find the right callback for member list?
 
Edit 1: Is there a location I can find where to find the right callback for member list?
/src/XF/Pub/Controller/Member

One of the action methods there should contain the information you are looking for. You will need to extend this controller and redirect its output to your own template. That's basically it.
 
Thanks :)

One of the action methods there should contain the information you are looking for. You will need to extend this controller and redirect its output to your own template. That's basically it.

Okay so far I made a Page under nodes and was trying to use a call back via that. Would it be better just to make a new addon with a custom template?
 
If you want a simple solution which works with copy & paste, yes.
Otherwise, you can stick with your callback but IIRC callbacks have to be static methods so you would need to rewrite the controller logic.
 
Top Bottom