• Resolved bckaz

    (@bckaz)


    I am pretty new to Pods – but, it has been VERY helpful for a couple of projects already!!

    My current project includes creating a “user directory” for the members of our site.
    I’ve managed to get it started – by following your tutorial. (THANK you)
    It works! It still needs a fair amount of work – but I’m excited to see its potential!

    I do have to resolve one (primary) issue though, or the whole thing is a bust:
    How can I exclude a few specific users from the directory?
    I am hoping that there is a way to do this – within the Pod / Pod Template / Magic Tags . . . etc? Using some form of conditional statements (?) . . . or ??

    We have about 10 users that need to be excluded from the directory before we can post it on our “Members Only” site. (a couple are Admins, and others have custom roles, thanks to Justin Tadlock’s Members plugin).
    I THINK I may need to exclude them – via their User ID(?) (excluding an entire role won’t work for us) . . . but, I have no idea HOW to exclude any of them – regardless of which identifier we use.

    Can you possibly point me toward any helpful information for this?
    I’ve been searching the web — and the closest thing I’m finding would require a bit more PHP than I know how to write.

    I’m not sure if this is possible — within Pods? – Maybe by using some kind of conditional statements(?) – or – could I create a custom field – for just those users – and somehow exclude them that way?
    Or . . . ?
    I just haven’t found enough “hints” – to help me do this yet.
    I’m really hoping I can get it done without having to hire someone to write php for us.

    Thank you – for any general guidance that you might be able to offer.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hello @bckaz

    I would normally advice you to exclude based on the user roles but since that isn’t an option you can simply list the user ID’s in the exclude parameter.
    A custom field (Yes/No) field for exclusion is also possible and might be easier for you to manage.
    Keep in mind though that while magic tags are handy, they do not support conditionals or other parameters.
    Pods shortcode supports all parameters from find: https://docs.pods.io/code/pods/find/
    You could add the where parameter, something like: where="excluded = 1" if your custom yes/no field would be named “Excluded”.

    Cheers, Jory

    Thread Starter bckaz

    (@bckaz)

    Thanks for the info. I did finally manage to get it working – using Pods templates.

    One thing that I found frustrating . . .
    When attempting to use the “Restrict Access” for a field — it turns out that I can’t restrict access to “Admins” — (nor could I use other options) — because one of our Roles includes the capability: “delete_users” — so that role can’t be ‘restricted’.

    Is that how it is designed to work?

    Thread Starter bckaz

    (@bckaz)

    Please forgive my ‘additional question’ — I started a new topic for it instead.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to exclude specific users from Pods User Directory’ is closed to new replies.