Skip Navigation

[Résolu] Populate a Cred field with data linked to the type

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

This topic contains 3 réponses, has 2 voix.

Last updated by Adriano Il y a 7 années et 4 mois.

Assigned support staff: Adriano.

Auteur
Publications
#209975

Pat

Hello,

Is it possible in a Cred form, to affect a specific value to a field that is already created?
For example, I have a type (Event) in which I have integrated a Cref form (Concours). I would like that a single ligne field (Nom) of this Cred form returns the Event's name. What's the best way to do this?
Regards
Pat

#210016

Dear Pat,

You will need two things to achieve that. A generic field to store these values and a view to populate it.

Your generic field should looks like:

[cred_generic_field field="teste" type="text" class="" urlparam=""]
{
"required":0,
"validate_format":0,
"persist":0,
"default":[],
"options":[ [wpv-view name="Test New"] ]
}
[/cred_generic_field]

Then you need to create a view with the correct filter you want, the output format should be like that:

<wpv-loop>[wpv-item index=1]{"value":"[wpv-post-title]","label":"[wpv-post-title]"}[wpv-item index=other],{"value":"[wpv-post-title]","label":"[wpv-post-title]"}</wpv-loop>

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

#213605

Pat

Thanks Adriano

#213673

You are welcome.