Skip Navigation

[Resolved] Select page template in CRED form?

This support ticket is created 2 years, 8 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/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 2 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2301591

a.R

Hi, is that possible?

Thank you 🙂

#2301821

Hello,

I assume we are talking about WordPress built-in page attribute "Template", it is using a custom post field "_wp_page_template"
If it is, it is possible with some custom codes, for example
1) in the post form for creating pages, add a generic select field:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_generic_field
Let users to choose the page template

2) Use action hook cred_save_data to save "_wp_page_template" value into database as a post field.

More help:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

#2303261

a.R

I mean TOOLSET page templates.
Does it work like that?

#2304595

Yes, Toolset Content Template is using a custom post field "_views_template" to store value, you just need to store the correct content template ID into that post field.