Skip Navigation

[Resolved] CRED – Select relationship from 2 distinct CPT in 1 select field

This support ticket is created 5 years, 2 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Shane 5 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1370023
Sans titre.png

Hello,

On a CRED Form, I need user to choose the relationship with the "Famous Artist" or the "Not yet famous artist" for his "live report" CPT.

For now, I use a solution in 2 steps, Allowing the user to say
1./ if the artist linked to his live report is "Famous" or "Not Yet Famous"
2./ Choose the artist from a select field.
(please see code here under)

Ideally, I would like to only have one field "Choose the artist linked to your live report" with all the "Famous artists" and the "not yet famous artist" in the query. The field would then regroup the title (artist name) of both CPT (famous and not yet famous).

Is there a way to have a select relationship field with a query on two different CPT ?

Thank you very much in advance.
Best regards,

<div class="row">
		<div class="form-group col-sm-4">
			<label>Artiste très connu ou étoile montante</label>
			[cred_field field='connu-ou-a-suivre' force_type='field' class='form-control' output='bootstrap']
		</div>
		<div class="form-group col-sm-4">
			<label>Reportage concert sur un artiste connu</label>
			[cred_field field='reportage-concert-artiste-connu' force_type='field' class='form-control' output='bootstrap' select_text='--- non défini ---']
		</div>
		<div class="form-group col-sm-4">
			<label>Reportage Concert sur Artiste à suivre</label>
			[cred_field field='reportage-concert-sur-artiste-a-suivre' force_type='field' class='form-control' output='bootstrap' select_text='--- non défini ---']
		</div>
	</div>
#1370149

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Serge,

Thank you for getting in touch.

Unfortunately no this is not possible as the fields are tied to each of their individual queries to retrieve the data for that CPT.

There isn't a way to combine them into one field for querying. Any solution for this would require a complete custom code to be written to replace the field.

Unfortunately such custom coding is out of the scope of our support forum.

Thanks,
Shane