Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch a list of members #9

Open
husseinalhammad opened this issue Nov 20, 2020 · 4 comments
Open

Fetch a list of members #9

husseinalhammad opened this issue Nov 20, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@husseinalhammad
Copy link
Member

Add a function to list members. e.g.

pipit_members_custom([
    'template' => 'list.html',
    'filter' => [
        [
            'filter' => 'status',
            'value' => 'active',
        ],
    ],
]);
@husseinalhammad husseinalhammad added the enhancement New feature or request label Nov 20, 2020
@ianhobbs
Copy link

I'm looking fo a way of geofencing members in regions.

pipit_members_custom([ 'template' => 'list.html', 'filter' => [ [ 'filter' => 'region', 'value' => 'nw_sydney', ], ], ]);

@husseinalhammad
Copy link
Member Author

The primary reason I have not implemented this function yet is to not go beyond the scope of the first-party Perch Members app.

The Perch Members app's purpose is to handle user authentication and control user access to different types of content. For simpler use-cases, you can also use it to manage (private) user profiles. The app does not handle complex field types nor does it allow filtering on custom fields.

I would suggest you link members to Runway collection items (using the Pipit Members app). This way you don't have to work around the limitations of the Perch Members app and can rely on Runway collections for managing the profiles.

Examples

Displaying the profile for a logged-in member:

perch_collection('Profiles', [
    'template'  => 'profiles/_detail.html',
    'filter'    => [
        [
            'filter' => 'member',
            'value' => perch_member_get('id'),
        ],
    ],
]);

Displaying a filtered list of members by the field region (mirroring your example):

perch_collection('Profiles', [
    'template'  => 'profiles/_list.html',
    'filter'    => [
        [
            'filter' => 'region',
            'value' => 'nw_sydney',
        ],
    ],
]);

I'm not saying a function like pipit_members_custom() wouldn't be useful, but for your particular use-case, I think you should consider relying on the Perch Members app for managing user authentication and Runway collections for managing profiles. The Pipit Members app's role here would be to make linking members to collection items easier.

@ianhobbs
Copy link

Thanks. Yes I can see that working. Next year have a chance to run some tests.

@montlewis
Copy link

I would love to see a perch_members_custom() function added. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants