christianwach / civicrm-wp-member-sync

CiviCRM WordPress Member Sync plugin keeps a WordPress user in sync with a CiviCRM membership by granting either a role or capabilities to a WordPress user who has that membership.
https://wordpress.org/plugins/civicrm-wp-member-sync/
GNU General Public License v2.0
17 stars 10 forks source link

An idea for a Membership block ?! #39

Open jbonlinea opened 2 years ago

jbonlinea commented 2 years ago

Hi there,

Roaming around here again, this PR #30 gave me an idea :)

Let me know what do you think ? I may do a big share of building it, with little help from you regarding the Civi side of it ;)

the context and the origin of the idea

the context will be the one describe in the pending PR, sumurised as the the need to differentiate :

The approach I may have taken if I was in this situation :

To conditionally display content, one may build a function that test if the user is logged in and has a give capabiity, and return true or false accordingly, then I see at least 3 options to use this fuction :

CiviWpMember-block

Why such block

Well,

What do you think ? I haven't though of it through the role sync option, as there is already many block that handle roles Do you think it is worth the effort and could find its place within civi-wp-member-sync ?

Regards

christianwach commented 2 years ago

@jbonlinea If I understand what you're after correctly, then it seems the Groups plugin already has the kind of functionality you're after:

The Groups Member block allows to restrict the visibility of its content to members of selected groups. The Groups Non-Member block hides its content from members of chosen groups. The blocks can be nested to provide multiple layers of access control to content.

This plugin is already compatible with Groups, so why not try that first?

jbonlinea commented 2 years ago

Hi @christianwach

groups : restrict content with shortcode --> issues

I gave try to the group plug-in a while ago, when it had no block yet, and we had to use shortcode to restrict content. This feature of group worked well to restrict basic content (paragraph, list, etc.) but messed up the ui when trying to restrict complex content (forms, civiforms, etc).

groups : restrict content wiht blocks --> works but, but incomplete feature

I've just re-tested the group plug-in which now do not break the ui. It's great, but

alternative solutions

why this idea

I can do what I want, but not any of the site owners/editors/blablabla, event the more advanced one, could by their own, and it seems that this block could help. My priority is most of the time for the visitor experience, then the editor one, here it helps the editor to build a better visitor/member experience.

As you have replied in the PR #30, the actual feature of the plug-in answer most people's needs, and it will probably never cover 100% of everyone's needs. I think the hard work has been done to sync capabilities, but is not usable to it full potential by its own, while a "stupid" capability block would enable it. Then having multi-select rather than text field for the block settings is where we empower site editors.

I don't know if a block included in this plug-in is the right solution, but at the moment that all I have :)

situating this issue in a broader context

I don't like the profusion of block that do the same thing but slightly differently from vendor to vendor, but here the motive also come from the overall lack of intertwining between Civi and Wp when it comes to provide a sleek visitor/member browsing itinerary and providing a feedback of the membership/payment situation. I've recently done a detailed testing of Paid-Membership Pro, and well, this is what I'm basically asked for and I can only say that this is also what I would like to offer to membership-managers/editors/users in this respect.

A feature I really miss to is a civi-wp-membership statute. If someone register civiform to become a meber, he receive a mail, but there is no spot on the site where he could see his membership statute, I don't even speak of downloading his bill.

what I did is used civicrp-wp-ux to get some few field, it works okay, but is not translatable, create a form so the user can change he's details (email, postal address)(but it was with caldera and I'm not sure where we are going with that), etc. and I did it but a site editor couldn't

so a My membership block could also help a lot I think, well you get the broader idea

Cheers

In the civi-wp-block I think of, we could either define the membership type (or an array of membership types), or/and define membership statute (or an array of statute)

Now that I

Regards