Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 6 replies, 2 voices, and was last updated 5 years, 11 months ago by
Steven Zahm.
-
AuthorPosts
-
03/29/2017 at 12:32 pm #417808
Mike Raccine
ParticipantAfter submission of the form, I’m trying to redirect the user to his/her single listing using a custom page template that I identified in the Connections -> Settings -> Form Redirect option.
I can display the single listing using [connections id=2], but have not had success getting the ‘User Id’ on the fly and replacing the User ID in the shortcode.
Here is what I tried:
$single_entry_listing = $entry->getRuid();
echo do_shortcode( '[connections id=$single_entry_listing]' );
Just assigning the variable causes the page to quit.
03/30/2017 at 8:44 am #418098Steven Zahm
Keymaster@ Mike
Sorry, but there is no way to dynamically redirect back to the user’s profile page. After the user submits, they never leave their edit page. The form refreshes with their changed data. Is that not occurring?
04/06/2017 at 3:59 pm #419201Mike Raccine
ParticipantThe form does refresh, and shows the data with the form. Let’s just say my client is very picky and is not happy still seeing the form.
My thought, since there is an option to redirect after Form submission, was to send the user to a new page. On the new page I was attempting to display an individual listing using the shortcode [connections id=2].
If I write a MySQL query to get the current WordPress user-id, cross reference that to the connections table column ‘user’. Then replace the id# in the shortcode [connections id=2]. Would that not work?
04/06/2017 at 5:15 pm #419208Mike Raccine
ParticipantI think I misunderstood your response when you said “Sorry, but there is no way to dynamically redirect back to the user’s profile page.”
What is this checkbox for in the Form settings?
“Whether or not to redirect to a page after a successful submission”.I was able to come up with the MySQL query though as mentioned above.
04/07/2017 at 9:52 am #419253Steven Zahm
Keymaster@ Mike
re: What is this checkbox for in the Form settings?
“Whether or not to redirect to a page after a successful submission”.By default when an entry is submitted by a user the page will display a processing and then a thank you message. If needed you can optionally redirect to another page in your site. To enable the redirect, enable the Redirect option and then choose the page that the user should be redirected to.
YOu can only redirect to a separate page as an option. There is not an option to redirect pack to the user’s entry.
I do understand what you are asking for and have added it to my feature request list.
re: I was able to come up with the MySQL query though as mentioned above.
Well, yeah, with code it is definitely possible. When I said it was not, it was in context that there is no setting or configuration option available.
You could very likely use this:
Connections_Link::viewURL();
This function will return the URL of the user’s profile detail page. You possible could use this to redirect using the
wp_safe_redirect( $location, $status );
function to do the redirect … rather than making a SQL query.Hope this helps!
04/07/2017 at 12:17 pm #419266Mike Raccine
ParticipantThanks for all your help.
Am I correct to assume that the redirect only works on a NEW form submission and not on an UPDATE to an existing listing? That’s how mine functions.
04/07/2017 at 2:34 pm #419313Steven Zahm
Keymaster@ Mike
re: Am I correct to assume that the redirect only works on a NEW form submission and not on an UPDATE to an existing listing? That’s how mine functions.
I had to look at the code again…
Id does appear the only condition where the page is not redirected is when user has updated their entry.
Not sure why I made that distinction or if if was an oversight by me when adding the redirect feature. I’ve made note of it to investigate further.
-
AuthorPosts
You must be logged in to reply to this topic.