Skip Navigation

[Waiting for user feedback] Private collection not displaying properly

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 1 voice.

Last updated by Minesh 2 days, 16 hours ago.

Assisted by: Minesh.

Author
Posts
#2810653
Header_User_Admin.jpg
Header_User_Member.jpg

muselink.ch is a site/platform allowing museums to display exhibits of artworks ans other items.
If visitors are members, they can create their own private collection (CPT "Membre") of items (CPT "Objet") : which is the functionality I am trying to develop at the moment

I followed the instructions of a support ticket I had submitted 4 years ago, entitled "Make user able to create her own Collection (one) of Artworks (many) View". Back then, I was developing that functionality on a site buit on Elementor.
But now muselink.ch is built on Gutenberg with the Kadence Theme/plugins and Toolset plugins, because it allows multiple content templates for the same Custom types, and powerful dynamic displays...

======
access details removed.
======

The state of the development of the private collection of the user Utilmembre can be seen here :
hidden link
It has several issues, that I am explaining in detail below :

I.- HOW IT SHOULD WORK : (the site is in French)
a) the user, with the role "Membre" is created by the site admin, who sets Username (e-mail) and Password
b) the member user logs in with the credentials given by the admin, and has a user menu "Mon compte de membre", wich is a page displaying the "Créer ma collection" Form (Create my Collection Form), which she submits and is redirected to the homepage
c) then when returns to the "Mon compte de membre" page, she sees the link to her collection (CPT Membre): a view with the filter Member Author = Logged in User
d) her collection displays a view with a custom search and a gallery of items/artworks (CPT Objet) - previously setup as a starter by the admin
e) each item the gallery has a link to delete the item from the gallery
f) conversely, in any exhibit gallery, each item has a link to connect the item to her private collection
NOTE : as long as a user does not have the role of "Membre" AND has not created her collection (CPT Membre) it has no access to any private collection

II.- THE COMPLETED STEPS SO FAR :
a) role "Membre" defined OK
b) CPT "Membre" & Custom Fields group created OK
b) many-to-many relationship Membre - Objet OK
c) page "Mon compte de membre" page created OK
d) Single Content Template for "Membre" created OK

III.- ISSUES :
1.- "Mon compte de membre" page : hidden link
--> the form "Créer ma collection" does not display for user with the role "Membre" ; I tried to setup a Conditional block, but to no avail
--> the View "Liste des Membres" (1 column) does not display for user with the role "Membre" either, even though the filter is "Member Author = Logged in User. I tried to manage the permissions in Tooset Access Control, and also in the User Roles Editor, but to no avail...
1.1.- SIDE NOTE : also for the users with the role "Membre", the header's main Navigation's display is stretched ans w/o drop-down hierarchy (see attached screen shots ) : I also put this issue to the Kadence Theme Support Team.

2.- Single Content Template for CPT Membre "Modèle pour Membres" : hidden link
BTW : the custom search will be completed later, it has only 1 search field for now
--> the gallery of Items (CPT Objet) displays OK, with the exception of the link to delete the item from the collection "Sortir de ma collection" :
____ visible here, when logged in as admin : hidden link
____ not displayed, when logged in as a user with the role "Membre" : hidden link

Well...
Thank you for having red this ticket up to here : I think following a process described 4 years ago might be missing crucial elements, or the functionality could be achieved in another was today. Luo Yang did a really great and patient job then, but I had found another way to set it up, with an Elementor related plugin. Since then I ditched Elementor, which became a real hassle.

Thank you for helping me achieve this private collection functionality.

Best regards,

Francesco De Grandi

hidden link

#2810668

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I think we will require to split the ticket with every new question you may have. Lets fix the issue step by step.

On the following page: hidden link

When I edit the above page in backend, I can see there is a view added and view is set to displays posts where current loggedin user should be the author of the post.
=> hidden link

But when I checked the post "ultimember":
=> hidden link

The author of the post is "François De Grandi", so I've changed the author of the above post to "Test Utilmembre" and I can see the "Utilmembre" post get displyed on the following page.
- hidden link

Regarding the Toolset form, I tried various ways but I do not able to find conditional block or conditional shortcode working.

If I add the form directly without conditional block or conditional statement, then it works.

Maybe it could be due to the slug conflict.

You have post type configured with the slug 'membre'
=> hidden link

And you also have the custom user role with the same slug 'membre':
- hidden link

With WordPress it's always a good practive to go with the identical slugs. I suggest you should try to change the slug of post type Membre or custom user role 'membre' and then check if you able to see the conditional statement working.

#2810977
View Loop Template.png

Hi Minesh,
Thank you for your prompt response to my multiple questions...

As for this first issue of the page /mon-compte-de-membre/:
- yes, I realize I did not log in as the Utilmembre before authoring the Membre instance ; hence the issue
- so now the View displaying the view displaying posts where current logged in user is the author of the post

The other intent was to first display the form (to create th Membre instance) , and after creation, when coming back to that /mon-compte-de-membre/ page, to display the Membre :
1.- I followed your suggestion that the Role slug and the CPT Membre slug could conflict, and I renamed the CPT Membre "Collection personnelle : precaution taken.
2.- on the page /mon-compte-de-membre/ , I tried to display the form first, with a conditional depending on the result of the above mentioned View : but since the Collection personnelle Post is not created yet, the view return nothing, and the condition can not be checked...
3.- so I found a workaround : In the short code for the View Loop's Template, I added the HTML to display the form :
--> this did not work properly; so I decided instead to put just an instruction for the viewer to create her Collection personnelle, and a link to a page with the form :
--> like this : [wpml-string context="wpv-views"]<p>Vous n'avez pas encore de collection personnelle.<br>Veuillez cliquer sur le lien ci-dessous pour en créer une :</p><br><h3 align="center">hidden link">Créer ma collection personnelle<h3>[/wpml-string] (see attached scree shot)
4.- now, when returning to the page /mon-compte-de-membre/ , the right created Collection personnelle displays correctly its title with a link to the right Collection personnelle

Then, in the Single Objet Template, with a Kadence Row conditionnai (seemed to work better than the Toolset conditional in this case) inserted the Relationship form short code for connecting the current Objet to the Collection : which works fine.
And in the Single Collection personnelle Template View Item, with a I added the short code for disconnecting the current Objet from the Collection personnelle : but here I stumbled on an other issue :
- the short code would not display for the Role "Membre" : I tried a lot of configurations of that Role's permissions, but to no avail
- so I added tho the user another role : Editor (WP default role), and the short code displayed properly :
--> I do not understand why I could not fix this issue without adding that Editor role : Do you have any suggestion ?
- I think I can live with it though, because the "Membre" role will nor have any access to the back end anyway (Display Admin Bar unchecked in the User's Account page).

By the way, last point : about this problem of the main navigation not displaying properly for the role "Member" :
- in Toolset Access Control, I had to create a Groupe de publication for Membres, and give access to one of the navigation's main Item page, and then the menu displayed correctly
--> this is also very surprising to me : it looks like if a role has no access to a page, the link to that page also does not display properly : Is that right ?

Thank you for shedding some light on the 2 above mentioned questions.
Best regards

Francesco De Grandi

#2811262

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I'm not sure how exacly the Member role was created.

Have you used "copy from": xx role when creating member role?

I'm not sure what exalctly not working for you. Maybe you can share problem URL and exact steps I should follow in order to see the issue with admin and frontend user login access details and what is your expected results.

I have set the next reply to private which means only you and I have access to it.