• I’ve been messing around with Custom POst-Types and Forms in WordPress and am able to create a page to submit information to WP database from Custom Post Type.

    What I haven’t been able to figure out is how to set up a page to view the submitted information and edit/delete a row of the info.

    Using a different web app building tool, I was able to create a form for a new item:
    https://goo.gl/photos/G5fqe4CVqj28CZMK6

    And then view the submitted items in a grid format, with checkbox for edit, delete, etc.
    https://goo.gl/photos/vArUFiQeXZRBMVVa8

    This item list is what I am trying to do in wordpress. I have tried various plugins for forms like Toolset, ninja forms and cadera forms, but cant figure out how to generate a good, working view of the submission. Trying to do this without buying anything initially. I am willing to write PHP as well.

    • This topic was modified 7 years, 9 months ago by aquastats.
    • This topic was modified 7 years, 9 months ago by aquastats.
    • This topic was modified 7 years, 9 months ago by aquastats.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Into your wp-admin go to the list of custom posts
    and click on the title of any post.
    It will bring you to the view that you have in the frontend for the custom post.

    After that you can work to edit the template of that page

    Thread Starter aquastats

    (@aquastats)

    I definitely would like to be able to edit a post in the same form where new items can be created.

    But what I am looking for is to display the list of items (submissions) from the form, like this:Item List

    IT will allow user to sort columns and select row for editing.

    It is kind of like taking the post type list in wp-admin and exposing that to the user.

    Thread Starter aquastats

    (@aquastats)

    For example, in Ninja FOrms (or Caldera FOrms), I have two forms created – Tanks and Parameters. When I submit data into each form, it stores the data in the database.

    There is a menu option called Submissions, where I can select a form and it will display the submitted data with the form fields as columns.

    Submissions

    I’d like to be able to take that screen and use it as-is on the front end for each form.

    So USer can submit Tank information, then pull up list of tanks (Submissions) and select one and edit in form.

    It looks like the Submissions screen is a post-type, and the edit screen is a post edit screen.

    is there a way to take these wp-admin pages and lock them down so users can access them for the add/edit/delete functionality I am looking for?

    • This reply was modified 7 years, 9 months ago by aquastats.
    Moderator bcworkz

    (@bcworkz)

    You can define unique capabilities for a particular post type. A user without these capabilities cannot do anything related to the post type, not even admin users. They too will need these capabilities assigned. Those with the capabilities can do whatever that capability allows, even if they are only a subscriber role otherwise. If the current admin screens for the post type meet your needs, then managing capabilities is the way to go.

    “the Submissions screen is a post-type, and the edit screen is a post edit screen.”

    Not quite. The submission and edit screens might be the same thing. What is allowed is determined by capabilities of the user. The post type would be tanks in your example. Each tank’s data could be stored in post meta. Every tank is a different post of that type. It’s up to you how your submissions and edits are displayed and handled. You could use the current admin forms if they meet your needs. It doesn’t sound like they do from your description. In particular, post meta is not handled very well by WP by default. This could be cured by adding a custom meta box to the post/tank edit screen and/or customizing the post list table columns.

    Depending on the user experience you would want, the admin forms might leave much to be desired. If nothing else, the WP back end is not themed anything close to your front end. For the best UX, you may wish to develop front end forms to handle tank post types. A UI built on a custom page template that is styled to be consistent with your theme is easily attainable if you are capable of building such a thing outside of WP. Custom page templates are little different. Perhaps where and how the data is stored and retrieved is different, but displaying the data and building the UI would be identical. I personally would go this custom page template route.

    You could still use custom capabilities to manage who does what with the data, and the back end forms could still be used if anyone cared to. Why would they if an awesome front end UI is available? ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding Custom Post Type to WP Page’ is closed to new replies.