Support

Account

Home Forums General Issues Building a "Diary" with ACF and CPT

Solving

Building a "Diary" with ACF and CPT

  • Hi folks, I’m wondering if there is a clear way to achieve what I’m wanting with ACF and possibly the Flexible Content add-on and CPT’s.

    My intention is to use custom post type called “Lessons” to create content that goes into a series of posts for a self-development course. Once logged-in, users are able to read through a ‘Lesson’, then using a form at the bottom of the content, add some personal thoughts/feedback (purely for their own reference later on). I was hoping to make the questions for each ‘diary entry’ flexible by adding them to each Post using ACF and the Flexible Content field (so I can generate as many or as few “questions” as possible).

    The main bit that I’m unsure of is how to create a user-input form based on the Flexible Content fields for each Post.

    I have looked at the acf_form() function, but it doesn’t seem to give me the desired functionality out of the box, it allows you to update the questions themselves per post (even allowing you to add your own questions with the “Add Row’ button), but I was thinking the way forward would be to create form from the Custom Fields that creates/updates a custom user_meta or post_meta with an Object that has their responses for the questions?

    I am only a new developer and am pretty clueless as to how I might achieve this and what the best method to do this might be. Any thoughts?

    Thanks

  • Hi @heavyside

    Thanks for the question.
    Instead of using the flexible content field, I would be more inclined to use WP comments to handle the questions data.

    The flexible content field is great for customizing the layout of content, but is not a good tool for storing user comment data.

    Does that help?

    Thanks
    E

  • The storing of the data definitely sounds like it would be best done with Comments or post-meta or something, my struggle is creating a configurable “questions” platform so the client can configure a unique set of questions for each post. I was hoping that could be achieved with ACF and the flexible content add-on, but I guess I’ll need to look into another option.

    I was thinking that perhaps I could go a different way and use Gravity Forms to configure a form for each post, then use the ACF+GF add-on to allow the client to select the desired form to inset into the post? The trick would be on the front-end, finding if a form has been filled out before (by the current user) and then choosing to display the results instead of the input fields…

  • Hi @heavyside

    Perhaps you could explain with more details what exactly your requirements are both in data relationship and visual representation on your website?

    Thanks
    E

  • This reply has been marked as private.
  • Hi @heavyside

    If the form will be different for each lesson, then you will indeed need to use a plugin such as gravity forms to create the form.

    You can then use ACF as suggested to select a form for each lesson.

    I hope that helps.

    Thanks
    E

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Building a "Diary" with ACF and CPT’ is closed to new replies.