Skip Navigation

[Resolved] Conditional output only works on first post type in post form

This support ticket is created 4 years, 7 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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by pascalH 4 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#1658795
image-1.jpg

Good day team

In brief: I would like to use the conditional output in a CRED post form where multiple taxonomies apply in 1 posttype.

What has been done:
- There is 1 post type
- This postal type has multiple taxonomies
- CRED form to post a post has been created and linked to the Posttype

I am very convinced that everything is set up properly.

When I add a conditional input that relates to the 1st created taxonomy, everything goes well, the field is displayed on the frontend when the condition is met. It will not work with the taxonomies created later and linked to the same post type.

An example of the code

<!-- The taxonomie fields that the user must fill in (select field) -->
<label>Label name:</label>
[cred_field field='taxonomie-name-1' force_type='taxonomy' output='bootstrap' display='select' single_select='true']

<label>Label name:</label>
[cred_field field='taxonomie-name-2' force_type='taxonomy' output='bootstrap' display='select' single_select='true']

<!-- These fields must be shown or hidden -->
<!-- taxonomy 1 does work -->
[cred_show_group if="( $(taxonomie-name-1) eq '1' ) OR ( $(taxonomie-name-1) eq '2' ) OR ( $(taxonomie-name-1) eq '3' ) " mode="none"]
<div class="form-group">
[cred_field field='fieldname' force_type='field' class='form-check-input' output='bootstrap']
</div>
[/cred_show_group]

<!-- taxonomy 2 does not work -->
<!-- Example not ok, field is always showing, should only be showing when select for example taxonomie-name-2 = 1 -->
[cred_show_group if="( $(taxonomie-name-2) eq '1' ) OR ( $(taxonomie-name-2) eq '2' ) OR ( $(taxonomie-name-2) eq '3' ) " mode="none"]
<div class="form-group">
[cred_field field='fieldname' force_type='field' class='form-check-input' output='bootstrap']
</div>
[/cred_show_group]

It is strange but it seems that conditional output only works with the first created taxonomy linked to a post type.
Taxomies created later do not seem to work. I have tested with multiple taxonomies but only the 1st one works
The ID numbers and slugs used have been entered correctly, I have checked this.

Do you have an idea what this could be?

Thanks in advance for your help
Greetings Pascal

#1659569

Hi,

Thank you for contacting us and I'd be happy to assist.

During testing on my website with similar fields and conditional groups, I couldn't reproduce this issue.


<div class="form-group">
	<label>Listing Types</label>
	[cred_field field='listing-type' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
</div>

<div class="form-group">
	<label>Listing Locations</label>
	[cred_field field='listing-location' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
</div>


[cred_show_group if="( $(listing-type) eq '3' ) OR ( $(listing-type) eq '4' )" mode="none"]
	<div class="form-group">
		<label>Listing Field 1</label>
		[cred_field field='listing-field-1' force_type='field' class='form-control' output='bootstrap']
	</div>
[/cred_show_group]

[cred_show_group if="( $(listing-location) eq '6' ) OR ( $(listing-location) eq '7' )" mode="none"]
	<div class="form-group">
		<label>Listing Field 2</label>
		[cred_field field='listing-field-2' force_type='field' class='form-control' output='bootstrap']
	</div>
[/cred_show_group]

In case you've checked the taxonomy fields slugs and term IDs and they're correct, I'll need to see how this form and taxonomies are set up on your website's back-end.

Can you please share temporary admin login details along with the link to a page where this form can be seen?

Note: Your next reply will be private and though no changes will be made on your website, please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1661109

My issue is resolved now. Thank you!