Skip Navigation

[Resolved] How to create child post link when using elementor template

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#1863957

Tell us what you are trying to do?
I have created two CPTs: 1) Project Prompts, and 2) Project Submissions.
Every project prompt can have multiple submissions so it is a one-to-many relationship. I have set that relationship in toolset.
I have created a elementor template for Project Prompts post type. I want to add a custom post link to "project submissions" post submission form.
Goal: The user will see the "Project Prompts as a card" with a CTA to submit their project. Once they click on the link, user is directed to the submit "project submission" form. When the user submits the "project submission" the parent "project prompt" will be linked to the "project submission". Once that is done, I will create a view that shows fields from both "project submissions" and "Project prompts" that are linked together.

Is there any documentation that you are following?
I used this documentation but it wants me to create a content template outside of elementor. My whole product has been built in elementor and it seems like once my template is not in elementor, I cannot create any other custom post templates in elementor.

https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/

Is there a similar example that we can see?
under development

#1864241
form-settings-example.png

Hi,

Thank you for contacting us and I'd be happy to assist.

> I used this documentation but it wants me to create a content template outside of elementor. My whole product has been built in elementor and it seems like once my template is not in elementor, I cannot create any other custom post templates in elementor.

- When using Elementor, our recommended approach is to assign Toolset's content template to the single post pages and show the Elementor template/design inside it through the "Elementor Blocks for Gutenberg" plugin. Here is a guide on the topic:
https://toolset.com/course-lesson/using-toolset-with-elementor-page-builder/

However, if for some reason, you'd like to continue with the Elementor templates which are directly assigned to the single post pages, you can follow these steps:

1. In your form to add a new "project submission", you'll include the field to select the parent "project prompt" and set it to get the value from a URL parameter, for example, "project-prompt".
( screenshot attached )

2. The next step would be to create a call to action link in the "Project Prompts as a card", that includes the current "project prompt" post ID in the form page's URL.

Suppose, this form to add a new "project submission" is available on the page:
yourwebsite.com/add-new-project-submission

The link with the URL parameter would look like this:
yourwebsite.com/add-new-project-submission?project-prompt=1234
( where 1234 is the ID of the current "project prompt" post )

As a result, when the visitor will visit this form's page, the parent "project prompt" post will automatically be selected in the relevant field.

Tip: You can use the "wpv-post-id" shortcode to add the current "project prompt" post ID in the call to action link for the form page:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-id

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1864857

Waqar,

Thanks a lot for your help. The solution worked except for one thing. I was hoping to pass the parent "project prompt" to the child "project submission" without making the parameter visible to the user as it should be obvious that the "submission" was created for a particular prompt. Is there a way to hide the relationship field in the form from the user and still pass the "project prompt" id?

Thanks,
Himanshu

#1865631

Thanks for the update.

I find two separate points in your last message:

1. Is there a way to hide the relationship field in the form from the user and still pass the "project prompt" id?

- If your concern is only that in the form to add a new "project submission", the user doesn't see the field to select the parent "project prompt", it can be hidden using the custom CSS code.
( the value will be already selected through the URL parameter )

2. I was hoping to pass the parent "project prompt" to the child "project submission" without making the parameter visible to the user as it should be obvious that the "submission" was created for a particular prompt.

- If you don't want to pass/show the target "project prompt" post ID in the URL parameter, we'll need to find some other way to let the form to add a new "project submission" know which "project prompt" post should be linked.

One possible workaround is that the form to add a new "project submission" is presented on the single "project prompt" post pages and not on a separate/independent page. This will allow you to pre-select the current post in the field to select the parent "project prompt" (without any URL parameter) and hide the field using custom CSS code.

#1865741

Waqar,
My issue is resolved now. Thank you!