Skip Navigation

[Resolved] 2 fields from user form must be pulled to the user content template

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 8.89 hours from now. Thank you for your understanding.

This topic contains 4 replies, has 2 voices.

Last updated by Christian Cox 2 months, 4 weeks ago.

Assigned support staff: Christian Cox.

Author
Posts
#2091241

Hi there,
We just had some feedback from the authorities that we have to meet in order to start our company.

One of them is that when a user creates a camp, there must by default be 2 things showing on the content template / the camp:
1) The field called "CVR-number" (VAT number)
2) The field called "Navnet pƄ din klub" (The name of your club)

Both fields are being filled out by the host during the signup as a host-role here: hidden link

Is it possible to pull those 2 fields into the users content template when they create a camp? If you need a login please let me know

#2091243

Oh and the host must not be able to edit these 2 fields in the frontend or backend šŸ™‚

#2091975

Christian Cox
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Screen Shot 2021-06-17 at 4.02.12 PM.png

Is it possible to pull those 2 fields into the users content template when they create a camp?
Hello, if the host is the post author of the Camp post, you can display the host's User fields in the Camp template using Types UserMeta shortcodes with user_is_author='true' like this:

[types usermeta='user-field-slug' user_is_author='true'][/types]

Replace user-field-slug with the slug of the custom field you want to display. You can place that shortcode in the Content Template for Camps to display the Author's custom field in the Camp post.
https://toolset.com/documentation/customizing-sites-using-php/functions/

Oh and the host must not be able to edit these 2 fields in the frontend or backend
If you do not include these fields in any Edit User Form, the host will not be able to edit the fields in the frontend of the site. If you want to prevent backend editing, You can use the User Field Group settings to show or hide a field group from specific User roles. See the screenshot here for details about that.

#2092249

Thank you for your reply Christian šŸ™‚ I will try it out but it makes perfectly sense!

I am creating a new ticket since the content template looks weird again - one of the containers have a huge margin to the left and the map is missing in the frontend - even though both things looks normal and works in the backend editing. You can see this link: hidden link

#2094905

Christian Cox
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Ok understood, I will follow up there.