How to populate (and update) a form from a specific post?

I have a custom post type and a new post is created when someone makes a woocommerce order.
I’m trying to create a page which shows a form with the details from this CPT.
I’ve made a function which returns the CPT id according to the logged in user.

How can I populate the form according to this specific custom post?
If I enter {post_title} in the field value it gives me the page’s post title, not the custom post’s title.
i tried {brf_post_title} and it displays the code ‘{brf_post_title}’ not the dynamic value.
i tried {brf_post_title:181} and again it just shows the code.

I’ve tried adding the custom post id as ‘context’ but it still displayed the current page title.
I tried using {post_title:post_id=181} as the value, but still it displays current page title.

What am I missing here?

image
image

You need a reference of your post, for example includung the post id into the URL params. Then, for instance, you can use {url_parameter:id} to add context to the {brf_post_title} tag.

As help, you can follow this tutorial from Paul:

In general, he is doing exactly the things you’re asking for :slight_smile:

1 Like

thanks so much for your answer.

wow, yes, great video which clears up a few things…
it did turn out that ‘Dynamic Data Tags’ were turned off in the bricksforge settings which explains why the brf_ tags weren’t displaying at all on the front end…

if i wanted to use another variable instead of {url_parameter:id}, is it possible?
i tried a few variations and none of them worked (but the {url_parameter:id} did):
for example to take the post id from a hidden form field i tried:
{brf_post_title:{brf_form_live_value:update_id}}
{brf_post_title:{{update_id}}}
but these just showed the code, so i guess some syntax is wrong.

i want to do it like this because i want this to be the first page the user sees when they login so there isn’t a url parameter at this point.
i have a function which gets the id of the post to be edited from the id of the logged in user.

any idea what i’m doing wrong?

edit : found the solution!
something i tried before but didn’t work ( i think because Dynamic Data Tags were off) is passing the function value to the brf tag :
so this worked :
{brf_post_title:{echo:get_relateddetails_id_for_user()}}

this is such an amazing tool!
thanks Daniele!

1 Like

Great to hear! :slight_smile: