Skip Navigation

[Resolved] Using Content Templates for Cred user and post form fields

This support ticket is created 2 years, 10 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 5 replies, has 2 voices.

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

Assisted by: Luo Yang.

Author
Posts
#2261637

Hi, i have several Cred Userforms and CPT-Forms. Many of them use the same fields, for example "Name, email, password".
The fields are using a lot of CSS, JS and Bootstrap customization. It is a pain changing every single form when changing anything small like a tooltip. I was hoping that it is possible to use templates for those fields to insert in the forms.

I tried it like this:

          [wpv-post-body view_template="user-formular-sektion-id-mit-passwort-sek_konto" suppress_filters="true"]

and it works! Everthing is fine and works, fields are showing up and saving values as expected. The only thing that doesn't work is the form notification, it does not show up the email field in Settings – because email is in a template.

I could live with it, when i am not able to put email - field in a template but i wanted to ask if i should avoid working with templates for cred-fields, or is it fine to do this? I could not find any answers in old Support posts.

Kind Regards
Fatih

#2262471

Hello,

The shortcode [wpv-post-body] is for displaying post information, you can try to use "item" attribute to specify the post, for example:
[wpv-post-body view_template="user-formular-sektion-id-mit-passwort-sek_konto" suppress_filters="true" item=123]

Please replace 123 with the specific post ID

More help:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body
The “item” attribute is used to get the context when retrieving data from a post that is different from the current one.

#2262519

Hi, I know what toolset meant the templates to be. But my need is understandable isn't it? Everything in Toolset gets nested and reused but forms always need a lot of redundant work, field-templating is not such a bad idea isnt it.
is it something you would not recommend, tough it works?
Wich post ID should get placed there? The Post where the form will show? or the template ID? Can you explain please?

Since everyone seems to use blocks i am hoping that the good old "legacy" mode stays forever and i can ask questions like these. In blocks everything feels slow and redundant. I liked the way toolset made everything possible ... since blocks everthing seems less flexible and a lot of things got more difficult because they meant to be more easy to use ... with fancy gui. I tried blocks for 2 Months. Does not work for my needs ...

#2262573

I assume we are talking about user form, and you are going to display the user's custom user fields in the email notification content, if it is, you can specific the user's ID like this:
[wpv-user field="user_email" id="%%USER_USERID%%"]

More help:
https://toolset.com/course-lesson/send-notifications-when-someone-submits-the-form/#displaying-user-information-in-notifications
section "Displaying User Information in Notifications"

It is not recommended to use content template shortcode in user form.

#2262581

It is about using groups of formfields in multiple forms, instead of copy paste these fields. Not the content, the fields themselves. Not in notifications.
Did you understand? It is working, my question is, if i should avoid this for whatever reason …

#2263267

As I mentioned above, it is not recommended to use content template in Toolset user form, content template is for displaying post information, but in Toolset user form is not post/page, so it might conduct other unexpected results.