Skip Navigation

[Resolved] Display custom field default value on front end

This support ticket is created 7 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.

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 8 replies, has 2 voices.

Last updated by Tiit Sau 7 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#533219

I have defined default value for Types custom field.

I expected to see this value on front end permanently.

But it appears after post save only.

#533259

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Do you mean you are using CRED form and with CRED field you want to set default value?

#534063
new param.png

It's a multilingual live product catalogue with ~300 entries.
hidden link
Product parameters all based on Types custom fields.
Now i add a new custom field with pre defined Default value.
Until now it all works - New field appears on product edit view and on the front end product page.
On the image you can see "My default Value", which i wish to show up on front end without editing and saving all post one by one.

#534067

Minesh
Supporter

Languages: English (English )

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

Well - could you please tell me what kind of field type you are using and using which shortcode you are trying to display the field on the frontend?

#534070
field type.png

Field type is simple "Single line".
Here is my very simple shortcode [types field='my-new-parameter'][/types].

#534072

Minesh
Supporter

Languages: English (English )

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

I see you have set the field to translate. Is your field is translated? what if you set translation preference to "Copy from original" or "Do Nothing"?

If above does not help - Could you please share exact problem URL where you want to display the default value.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#534084

We are going wrong direction.
This not an error.
I understand the Default Value is for easier creating new post.
Will solv it other way, if no attribute to force show up default value.

Like this:
[wpv-conditional if="( $(wpcf-my-new-parameter) eq '' )"]Hand made Def value[/wpv-conditional]

#534089

Minesh
Supporter

Languages: English (English )

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

Yes - thats the correct way to check if field is empty or not.

here is the another way to check empty value::

[wpv-conditional if="( empty($(wpcf-test-field)) )"]
This field is empty or does not exist
[/wpv-conditional]

More info:
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/

#534116

Resolved.

Thanks Minesh