[Resolved] Make user able to create her own Collection (one) of Artworks (many) View

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 28 replies, has 2 voices.

Last updated by FRANCESCOD7762 1 month, 2 weeks ago.

Assigned support staff: Luo Yang.

Author
Posts
#1562907

Hi,
I am building (Elementor & Toolset) a site for an Art Museum with the following CPTs : (the site is in French, so I give you both languages bellow)
- Exhibits | Expositions
- Art Works | Oeuvres
- Exhibit | Exposition is in a ONE TO MANY relationship with Art Work | Oeuvre
For each Exhibit, it's Art Works are displayed in a View with a Custom Search.

Users are tracked via the Hubspot CRM Plugin, as soon as they fill out a Form (Contact, Newsletter, Membership or MyCollection), or leave a comment to one of the Art Works, or to a Blog Post. Thus, there is a way to know not only whomis the current user, but also if she is a Member or if she has bought the "Favorite" extra feature described below.
I want any logged in User (current user) to be able to create her own Favorite Art Works Series, and display it with a similar View with a Custom Search.

I see the following strategy, but do not know how to achieve it:
- attach a "Put into Favorites" Button to each Art Work
- It would trigger the writing (how?) of the logged in username into a "FavoriteOwner" Custom Field (what kind?) of that Art Work
- than a View has to be created with the current user as the View filters, and the "FavoriteOwner" as the Art Works filter - which is to be equal to the current user
- and a trigger, for the displaying the User's favorite page with the View, has to be set somewhere, maybe in the Main Menu, only visible if the User is logged in.
- similarly, a Slideshow of the User's Favorite Art Work Series could be created and triggered.

That's the Idea, but I am not clear about how this has to be done, especially how to connect the current user to the Art Work CPT, and how to check if the current user is eligible to use the "Favorite" extra feature (has to be a Member or bought the feature).

On the site, to see the Exhibit page with the View, go to :
hidden link
and click the "Recherche des oeuvres" button.
If you click the "Voir défiler l'exposition" button, you will see a Slideshow.
If you click any Art Work displayed in the View, it will take you to it's Detail page, with a larger display (including zoom lense on hiver), and detailed descriptions of it's characteristics. This is where the "Put into Favorite button would be most adequate to be, since this page is an Elementor Template for Single Art Work | Oeuvre.

You can access the site admin : (it is a staging site on Cloudways)
hidden link
with the following temporary credentials :

Thank you for your feed back and your advice on how to create this functionality in the most effective way.
Tooset is an amazing tool : it has allowed me to build a pretty interesting site sofar, and I should be able to resolve this issue with your help.
Best regards,
Francesco De Grandi

#1563431

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

In your case, it needs to setup many-to-many relationship between post type "Art Work" and WordPress users.
So each "Art Work" post can connect to multiple WordPress users.
One WordPress user can connect to multiple "Art Work" posts.

But Toolset post types relationships are based on post types, in order to setup such kind of relationship, it needs a intermediate post type, for example:
1) Create a custom pos type "Member", each "Member" post's author is different WordPress user, and each WordPress user can have only one "Member" post.
2) Setup many-to-many relationship between post type "Art Work" and "Member"
3) In the single "Art Work" post, you can setup a relationship form, to connect the "Art Work" post with current logged-in user's "Member" post
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/
4) In the single "Member" post, you can setup a post view to display it's related "Art Work" posts
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items

More help:
How to Create Custom Searches and Relationships for Users
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

#1567099

Hi Luo,

Thank you for your prompt and very articulated reply, and sorry for the delay of this response from my part. I had to attend to other issues first, and did not have the time yet to implement this user feature according to your detailed instructions.
More specifically :
a) on point 1 :
-- How do I make sure that 'each WordPress user can have only one "Member" post' ?
-- How is this unique "Member" post created ? By the any visitor when she/he is signing up/registering as a user to the site (in WP tems, she/he then becomes a "subscriber") ? Or by the site administrator upon receiving the sign-up ?
b) on point 3 :
-- I understand that that form's button is what I described as the "Put into favorites" button, attached to each Artwork Single-Template (which I have already implemented with a Elementor Single Template) : this relationship form would be available only to registered/logged-in (current) Users, otherwise the connection between the "Member Post" and the current user would not exist. Right ?

There is anothe side to this solution, as you described it : are you assuming that the registered user IS a "Member" ?
If yes, the system has also to verify that this Member has payed it's subscription fees, before connecting to the current User : this is a process that has to happen outside of the many-to-many relationship between Artwork and Member that you described.

I am in the process to implement Memberships and Donations, for this Art Museum site, with the Givewp plugin, which has a way to restrict content to Members (determine Members only content, which is exactly what that "Favorites" feature is) : f.i. it would make sure that the "Art Work" post's relationship form with "Put into Favorites" button would be visible only to payed Members.
So now I have to :
1. first explore what the Givewp plugin is doing in terms of it's Membership features, i.e. content restriction
2. Implement the "Favorites" feature as you suggested
3. possibly connect the te two together

So thank you for you feed back on the above questions, and please leave this ticcket open, so I can get back to you if I have questions while implementing this process.

Best regards,
Francesco De Grandi

#1567599

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Q1) on point 1 ...

Please check the document I mentioned above:
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/#how-do-i-prevent-users-from-creating-more-than-one-contractor-post
section "How do I prevent users from creating more than one Contractor post?"

q2) otherwise the connection between the "Member Post" and the current user would not exist. Right ?
Yes, you are right

I have marked this thread as waiting for feedback status, you can update here if you need more assistance for it.

#1567641

Thanks for your prompt response.
I keep this ticket open, since it is going to take me a few days to get to the actual implementation of the Custom Types relationships and connecting to the Givewp Donation/Membership plugin state (as mentionned earlier.

Best regards,
Francesco De Grandi

#1568779

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I have to mark this thread as "waiting for feedback" status, you can update here when you need more assistance, thanks

#1576729

Thank you for keeping this thread open. I apologize for the delay, but this issue is quite complex.

I am using the Givewp Donations plugin to collect Membership Recurring Donations : when a visitor decides to become a Member and sends the subscription form, the Givewp plugin creates a new user with the Roles "Give Donor" or "Give Subscriber" or both, and loggs that new user in : so she/he becomes the 'current user' at this point : lt's say her login name is Caroll.

My question now is this : later, when Caroll logs in, how can I give her access to her single "Member" post ? :
- I thought about a Menu item like "My Collection" or "My Favourites", visible only to logged in users
- but then, how to designthe link so that it connects to Carol's single Member Post ?

Thank you for your help.
Sincerely,
Francesco De Grandi

#1576811

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

When user logged in your website, you can try these:
1) Show him a WordPresss page, with below post view:
2) Create a post view:
- query "Member" posts
- filter by post's author is same as logged-in user:
https://toolset.com/documentation/user-guides/views/filtering-views-query-by-author/
- If there is post found, display the Member post information:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-one-related-item-parent
If there isn't any post found, display below post form for creating new "Member" post:
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/

More help:
How to Create Custom Searches and Relationships for Users
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

#1576899

Thank you for your prompt response.
The process you describe makes total sense to me now : 'filter by post's author is same as logged-in user' is the key...
I just have to see how Givewp manages a Donor/Subscriber which did not renew it's subscription - i.e. did not pay the yearly fees - to see how I can deny access to the 'single "Member" post' of such a Member.

I hope to implement this in the next few days. I will keep you posted.
Best regards,
Francesco De Grandi

#1578029

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I have to mark this thread as "waiting for feedback" status, you can update here when you need more assistance, thanks

#1613473

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Removed the duplicated answer, please check the answer in your another thread:
https://toolset.com/forums/topic/relationship-form-3/page/2/#post-1613475

#1615157

Hi Luo,
Now, the View mentionned above in your April 7 message ("Membre: publication créée par l'utilisateur identifié (logged in)") in which this above Form is displayed when a Member is not found (= logged in User) -hidden link
... is not working properly :
- I created a new login and Member in the WP admin, then I went to the "Oeuvres" post and submitted the Relationship Form. The idg-913-lancetre was added to the Member. So far all is well.
- But when I open the /collection-de-member/ Page (the Elementor Page where I inserted the above View "Membre: publication créée par l'utilisateur identifié (logged in)", it displays both the Member Post Information (Filters but NO Oeuvres) AND the Form for creating a Member ("Formulaire pour Membres") [cred_form form="formulaire-pour-membres"]
Question : Is there something wrong with the way I configured the View ? Query ? Filters ? ...What is "The post where this View is shown" ?

Thank you for helping me understand what is going on here, because it is the last piece of the puzzle, to resolve the whole issue of this "Favorites" feature.

Best regards,
Francesco

#1616293

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I assume we are talking about the page:
hidden link

What is the purpose of this page?

If you are going to display a list of "membre" posts, you will need to create another new post view for it.

#1617293

Hi Luo,
Please visit again the page hidden link.
The purpose of this page is not to display a list of members.

It is supposed to display the view (hidden link ) which should behave as follows (according to your instructions of April 7th) :
- if no Member is found with it's author being the same as the logged in User, then it displays the Form for creating a new member (the form at lower half of the page hidden link) - [wpv-items-found]
-if a Member is found with it's author being the same as the logged in User, then it displays the list of Oeuvres related to that Member, with a Custom Search - [wpv-no-items-found]

I have tried now for 3 days to make this feature work, following your instructions : it still does not work properly :
1- when a logged-in user fills up the form, he is redirected to his collection
2- when he chooses the "L'ancêtre" Oeuvre with the Relationship form, the oeuvre is connected to his collection
3- he can then return to his /collection-de-membre/ page, where there is a link to his collection
4- HOWEVER : when he returns to the "L'ancêtre" single template, and clicks on the cred-delete-relationship "Retirer de ma collection", NOTHING HAPPENS
5- AND, when the same user logs out and logs in again, the /collection-de-membre/ page shows him the form again, as if there was no Member Post where the author is himself !

Since yesterday, I modified the View hidden link

Please test the above steps on your side again.
I have worked 3 days on this and still don't see what's wrong. Thank you for your help.

Best regards,
Francesco

#1619483

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Thanks for the details, I am checking it in your website, might be able to setup a demo, will update here if there is anything found