To explain my setup again, I want to have a portal that exhibitors to an event can log in and amend their pre-populated exhibitor details, add one or more brands and add one or more products per brand.
Exhibitor CPT has Brand CPT as a child and Brand CPT has Product CPT as a child.
On their portal home page, I want to pass a URL parameter in a link to a CRED form. I'm currently using hidden link which tells the CRED form which exhibitor it's associated with. Otherwise it will show a list of exhibitors for them to pick manually.
I want the URL parameter to be associated with their user.
Previous instructed received was:
It depends on how do you setup the "exhibitor-id for the current logged in user", if it is a custom user field created with Types plugin, you can setup a link, and pass the URL parameter "exhibitor-id" to the CRED form, you can get the value of "exhibitor-id" with Types shortcode, for example:
[types usermeta="my-field" user_current="true"][/types]
I've setup a user field so I can insert the ID of the associated exhibitor CPT. How do I add that shortcode to my "add a brand" link?
I'll gladly help you with this. I took a look at the previous ticket but it is lengthy and I think there may be some confusion about what is required, so let me refer my questions directly to you.
"I want the URL parameter to be associated with their user."
The URL parameter in question is used to pre-select the post ID of the parent exhibitor post. I'm not sure what you mean when you say you want it to be associated with their user.
If you have this post type structure Exhibitor > Brand > Product the simplest way to associate a user with the exhibitor (and the brand, and the products) is to make them the post author.
So the currently logged-in user visits an exhibitor dashboard which shows their exhibitor post, which has a link to a CRED edit form which they can use to edit their exhibitor details, and which contains a CRED child post link which can be used to create Brand posts that are children of that exhibitor (and which they will be post author of).
Likewise, any Brands can be listed on the same Exhibitor dashboard, with links to a CRED child post form to create Product posts for those Brands.
That's what I understand to be your requirements. Is that right? Which bit are you stuck on?
Yes, that's exactly what I want to do. I'll ignore what I was told before about using the URL parameter...
On the exhibitor dashboard, I want to show the the name of the post title of the Exhibitor with a link to a CRED edit form. I've setup a view which is shown on the dashboard that shows the Exhibitor post created by the logged in user. To create a link to CRED form. can I add
You can add it to the View that retrieves the unique Exhibitor post for the logged in user.
If you insert the shortcode using the Fields and Views button you should see that by default the post selection—the post to be edited using the form in the chosen content template—is the "current post being displayed either directly or in a View loop".
Keep asking about the next steps if and when you need help.