Skip Navigation

[Resolved] Default content template for custom posts submitted with CRED form

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to assign view's content template to posts created using CRED form

Solution:
Content template stored with postmeta key _views_template with each post.

To assign the content template to posts created using the CRED form, please add following generic hidden field to your CRED form before the submit button and save the form and try to create a new post .

For example:

[cred_generic_field field='_views_template' type='hidden' class='' urlparam='']
{
"required":0,
"persist":1,
"validate_format":0,
"default":"99999"
}
[/cred_generic_field]

Where:
- Please replace 99999 with your content template ID.

You can find proposed solution, in this case, with the following reply:
=> https://toolset.com/forums/topic/default-content-template-for-custom-posts-submitted-with-cred-form/#post-901645

Relevant Documentation:
https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/

This support ticket is created 6 years, 5 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.

Our next available supporter will start replying to tickets in about 0.34 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by olliM-3 6 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#901543

I am trying to: get custom posts submitted with CRED form to be displayed in a specific content template.

Link to a page where the issue can be seen:
hidden link
That page is a custom post type called "Volunteer".
I have setup "Volunteer" post types to be displayed with a content template called "Volunteers page"

I expected to see: The content template "Volunteers page" that I have setup to be used with "Volunteer" type posts.

Instead, I got: Now when users submit their "Volunteer" posts the posts are displayed in a wrong content template.

#901645

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - Content template stored with postmeta key _views_template with each post.

To assign the content template to posts created using the CRED form, please add following generic hidden field to your CRED form before the submit button and save the form and try to create a new post and check if content template is assigned or not.:

[cred_generic_field field='_views_template' type='hidden' class='' urlparam='']
{
"required":0,
"persist":1,
"validate_format":0,
"default":"99999"
}
[/cred_generic_field]

Where:
- Please replace 99999 with your content template ID.

#901687

Hi,

Thanks for the very speedy reply.
Minesh your solution solved my problem.

Thank you guys for the great support!