---------------- replacing the previous ticket, please open private reply here thanks
Hi all,
I have two different relationship forms on the same page (see picture). The first one has a parent selection, the second doesn't need it. The first one works perfectly, the second one would also, but the parent selection dropbox of the first one appears also on the other form preventing it to work because the selection is mandatory. If I delete the dropdown in the console also the second form works fine. I think this happens because Toolset generates the forms with the same code and I cannot hide the second with CSS because also the first one disappears. Is there anything I can do to work around this issue ? thanks
Regards
Nicola
If you check the Events content template:
=> hidden link
I've added shortcode block at the top of the content template and added the following two links to it:
<a href="/event-apply-as-band/?event_id=[wpv-post-id]"> <h1> Apply as Band </h1> </a>
==
<a href="/event-apply-as-musician/?event_id=[wpv-post-id]"> <h1> Apply as Musician </h1> </a>
We are linking the two pages you created with the current event Id.
Then, with the two pages you created:
- Apply as Band: hidden link
At top of the page I've added shortcode block and added the following shortcode to it to display the relationship form:
- Apply as Musician: hidden link
At top of the page I've added shortcode block and added the following shortcode to it to display the relationship form:
At top of the above event post you will see two links: Apply as Band and Apply as Mucician
once you click on any of the link it will redirected on the related page you will click the link on and it will also set the parent event automatically.
You can move the form where you want to display to whatever section you want.
Hi Minesh,
I appreciate your effort but the original problem still appears also with this page structure: when you apply as a musician the form doesn't work because there is a dropdown (select a band) that doesn't belong to that form and it shouldn't show !! it looks like that dropdown appears independently if the two forms are on the same page or not. That form is about the event-profile relationship, not event-band. This means that there is an issue (a bug ?) I GUESS related to the fact that both are relationships where the event is parent (hidden in both forms). The issue/bug is not related to the forms, but to something else.
ok, it seems that we are getting better BUT there is no need for a dropdown here, the current user profile must be automatically selected (if there is no profile yet this form is not shown and i've placed a conditional on the page showing a message inviting the user to create one). Of course surrent user should not be allowed to select someone else's profile.
Actually we don't even need a form here, parent and chid can be automatic, is there any other way than a form to do so ?
ok, it seems that we are getting better BUT there is no need for a dropdown here, the current user profile must be automatically selected (if there is no profile yet this form is not shown and i've placed a conditional on the page showing a message inviting the user to create one). Of course surrent user should not be allowed to select someone else's profile.
Actually we don't even need a form here, parent and chid can be automatic, is there any other way than a form to do so ?
===>
In order to connect the post we will require relationship form.
What profile post you want to see that should be automatically selected? Is it the case that you have a profile post available per user and based on the current loggedin user we need to find the profile post and that should be automatically selected?
Exactly. The parent (event) is the current one shown in the content template, the child is the profile of the current user (current user = author of the profili custom post). Each user can have just one profile. The form just need to show a button to create the relationship. You don't need to test if a profile exists for the current user, I do this before showing the form with a conditional. If it exists I show the form, if not I show a message "please create a profile".
Hi Minesh,
passing the paramenter the forms now look good, but no posts are created. The event-profile form seems to be working (I get a "done" message from the form) but the relation is not created. I've also tested the other form event-band, the form looks good but no relationship is created. This one form seems to do nothing at all. Please check, thanks