Hi,
I’m trying to let users create listings via a form without ever having to use the WordPress backend. I have a page with a form, edit entries shortcode and horizontal tabs which does the job. I’m wondering though if there’s a better way to do this. Here is my current structure:
Tab 1 “Add/Edit Listing”
-> shows the form
Tab 2 “Your Listings”
-> shows the edit entries link-list
Tab 3 “Add New Listing”
-> shows a link to the page where the fresh form is displayed (mywebsite.com/form/)
The reason for the 3rd tab is that when editing an existing entry via clicking an entry link displayed in Tab 2 the form in Tab 1 is loaded and filled with the corresponding entry data and the URL now looks like this mywebsite.com/form/?entry=zmxd7o&frm_action=edit.
The problem is that from now on the user isn’t able to add another new listing without knowing that he has to go back to http://mywebsite.com/form/ in order to find an empty form for a fresh listing. So basically it’s working with the link to the fresh form in Tab 3 but I’m wondering if there is a more elegant way to offer a frontend listing creation and management solution on one page?
Maybe you have an idea or know of someone that uses something similar but more streamlined…?!
Tanks,
Thomas.




February 20, 2012 at 3:52 pm
Are you asking if you can get rid of tab #3? If so, you could add a "clear form" button or something that would link to mywebsite.com/form (without the extra parameters to tell it you're editing). If this isn't what you're asking, can you please explain what exactly you would like to change?
February 21, 2012 at 7:28 am
Yes, I want to get rid of the 3rd tab... The "clear form" button is actually a really good idea and I will change my page layout accordingly - thanks!
Is there perhaps a conditional or a specific css class which I could use to hide the "clear form" button as long as the users are on mywebsite.com/form and not on the edit previous form (with the exra parameters) "page" ?
February 21, 2012 at 11:13 am
That part would need to be done with PHP. Maybe the easiest way would be to create a shortcode for the clear form link. Custom code goes in a new plugin or your theme functions.php.
add_shortcode('clear_my_form', 'clear_my_form'); function clear_my_form(){ if(isset($_GET['entry']){ return '<a href="">Clear Form</a>'; } }Now, add this shortcode on your page:
[clear_my_form]
February 22, 2012 at 1:14 am
Hi,
Great idea, unfortunately I get a white screen when adding this (including the correct URL ) to my functions.php.
But never mind, the clear form button on all pages is a good enough solution...!
Thanks for helping.
February 22, 2012 at 9:57 am
There was a ) missing. Example updated above.
Topic closed.