• Resolved griego62

    (@griego62)


    Hi Steve,

    Would there be a way to show fields according to user role? I would like members to be able to see extra information about businesses. Is there a way to do this, maybe by hiding fields using JavaScript and CSS? This would be great as it would allow directory monetization.

    Thanks in advance.
    Yannis

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Steven

    (@shazahm1hotmailcom)

    There is no direct method for hiding the “core” fields in Connections by role or other criteria. You could use custom CSS to hide fields from displaying. Basically, this only option because if the fields were removed using JavaScript, any data in those fields would be deleted from the Entry upon the form submission.

    That said, custom fields, you can show/hide based on role. You would follow the instructions in this developer doc:

    The change you would need to make is to add a current_user_can() call in the field callback to determine if the field should display or not.

    I hope this helps!

    Thread Starter griego62

    (@griego62)

    Hello Steve,

    Thank you for your reply. I need to restrict content and am thinking of purchasing Restrict Content Pro as I have seen that it is probably the best option and the one that you are thinking of developing an extension for. I would like to restrict certain content of the directory and was wondering if that would be possible and if it would be pretty straight forward. Any information would be valuable in order to not make a purchase in vain and accomplish my goal. Thank you for your time.

    Plugin Author Steven

    (@shazahm1hotmailcom)

    RE: I need to restrict content and am thinking of purchasing Restrict Content Pro as I have seen that it is probably the best option and the one that you are thinking of developing an extension for

    I’ve done a few bespoke solutions. Mostly “unlisting” an Entry when the WP User’s membership expires. Nothing that lets the members view/add specific fields within Connections.

    RE: I would like to restrict certain content of the directory and was wondering if that would be possible and if it would be pretty straight forward.

    I think the best that can be done is to use roles to define which role(s) can view public or private directory entries.

    Not sure my answers help, but I hope they do.

    Thread Starter griego62

    (@griego62)

    Thank you for always being there Steve! I’ll keep investigating a bit more as I am not a coder, which does not help much. I will look into how I can implement custom CSS to hide fields according to role, as you describe in your previous answer. As I have told you on other occasions, I think you are doing a fantastic job and provide great service. Cheers! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show fields according to user role’ is closed to new replies.