Display Post/Page Content using Gravity Forms (Best Practices)

Gravity Forms
20 August, 2021 17:07:39
Jisoros
Topics: 1
Messages: 2
What is the best approach for displaying user selected post or page content in a PDF?
In this scenario, the user selects from a drop down field in Gravity Forms: Post 1, Post 2, Post 3 or Post 4.
Upon submit, they receive a PDF generated by E2PDF of their selected Post.
20 August, 2021 23:38:34
E2Pdf
Support
Topics: 7
Messages: 3176
Hi,

Can you please clarify:

- Do you want to send PDF generated exactly for Page/Post (E2Pdf Template connected to "WordPress" -> "Page") or do you need just to output Page/Post content inside PDF along with other Gravity Forms data?

- Do you have preset of Page/Posts from which you need to generate data? Like "select" with 4 options? Or it's dynamic? Can you share please screenshots how it's setup on your Gravity Forms on backend and how it's showing on frontend.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
21 August, 2021 12:16:39
Jisoros
Topics: 1
Messages: 2
I want to just output the post content inside a PDF along with other Gravity Forms data. I am currently using the perk/add-on "Gravity Wiz Populate Anything" to output the value (post content) of the user selected post and it works very well. However, if one did not want to use that perk/add-on, what would be the way (best practices) the E2PDF team would use to achieve the same thing.
21 August, 2021 23:12:57
E2Pdf
Support
Topics: 7
Messages: 3176
Hi,

The best way can be to add own modifier via "gform_merge_tag_filter" hook to modify from Post ID to Post Content (If it's saved like this): https://docs.gravityforms.com/gform_merge_tag_filter/#description

https://codeshare.io/vwKnAW

And the usage inside E2Pdf must be as:

{Untitled:5:post_content}

Or another way can be is to populate field value with post content directly on submission via other Gravity Forms hook https://docs.gravityforms.com/gform_pre_submission/#1-populate-a-field to have post content directly with submission.

We remain at your service.
We would really appreciate your feedback at WordPress.org!