Skip Navigation

[Resolved] Conditional display of table

This support ticket is created 4 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 13 replies, has 2 voices.

Last updated by deepS 4 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#1508633

Hi,
I have created tables out of RFGs. But I want to hide the table when a custom field i.e. 'Interview/GD' from its parent view is checked. I tried to hide it with conditional output but in such a situation it affects the other tables too created with the same RFGs.
At present, I am using one Jquery code to hide the table columns when they are empty.
Please help how to resolve the issue.

#1509029

Shane
Supporter

Languages: English (English )

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

Hello,

Thank you for getting in touch.

Would you mind providing me with access to the site and the page where you are testing this out so that I can have a look ?

The private fields will be enabled for your next response.

Thanks,
Shane

#1509395

Shane
Supporter

Languages: English (English )

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

Hello,

I believe I found the issue.

Based on what I see you didn't add the view that is displaying the table within the conditional shortcode, so it was displaying regardless of whether the value is checked or not.

Thanks,
Shane

#1509431

Earlier I have added the condition. It was working partly, disrupting my other tables as there is a jquery code to hide the empty columns in the table. Hence I have removed the condition. Please have a look. Thanks.

#1509919

My issue is resolved now. Thank you!

#1509991
Screenshot_3.jpg

I am re-opening the ticket as I think I need some clarification in this regard. Hope you won't mind. I have applied the same conditional argument (since they are using same custom fields) in another nested view called 'Exam Detailed Syllabus Child', but it didn't respond as I was expecting.
Now let me clarify, does a conditional output depending on a custom field in the parent be put in the nested view? See what I have done in the 'Exam Detailed Syllabus Child' view to hide the heading.
The 'Exam Detailed Syllabus Child' is a nested view in 'Exam Detailed Syllabus' view.

#1513075

Shane
Supporter

Languages: English (English )

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

Hello,

For clarity, is the Exam Detailed Syllabus view a child view ? If I recall correctly this view is a RFG and the Exam Detailed Syllabus Child is a nest RFG correct?

In this case the you wouldn't be able to use the same parent field given that the Parent for Exam Detailed Syllabus isnt the direct parent for Exam Detailed Syllabus Child so the custom field you are using to check isn't available.

However you should still be able to hide this from the Exam Detailed Syllabus view, just add the Exam Detailed Syllabus Child within the same conditional as the table.

Please let me know if this helps.
Thanks,
Shane

#1513219

See Exam Detailed Syllabus is the parent view and Exam Detailed Syllabus Child is the child view of the previous one. They are in a direct relationship.

I simply want to hide the heading in the child view, not the entire content. Hope you got my point.
I used this code in the child view i.e. Exam Detailed Syllabus Child :

[wpv-conditional if="( $(wpcf-interview-gd-process) ne '1' )"]
		<h4><span class="exam-paper">[wpv-loop-index]</span> [wpv-attribute name="exam_param"] [types field="exam-paper-name"][/types][wpv-conditional if="( $(wpcf-exam-paper-name-alias) ne '' )"]: [types field='exam-paper-name-alias'][/types][/wpv-conditional] for [types field='exam-paper-mark'][/types] marks</h4>
      	[/wpv-conditional]
#1513517

Shane
Supporter

Languages: English (English )

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

Hi Deep,

Could you let me know what the code below returns ?

[types field = "interview-gd-process"][/types]

If this does not return a value please let me know.

Also because the ticket was marked as resolved previously then your login information was removed my the support system for security reasons.

Could you re-provide the information once more. This includes the credentials and the link to where I can test this out.

Thanks,
Shane

#1513963

Interview GD Process is a checkmark filed. When checked it is 1 and blank when unchecked. I can provide you login credentials if you wish.

#1514899

Shane
Supporter

Languages: English (English )

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

Yes please provide the credentials once more as well as the link to the page.

#1515087

Please check Exam Detailed Syllabus and Exam Detailed Syllabus Child view.

#1515303

Shane
Supporter

Languages: English (English )

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

Hello,

This should be working now.

The correct conditional should be
[wpv-conditional if="( '[types field='interview-gd-process' item='@exam-paper.parent'][/types]' ne '1' )"]

This is because you need to now target the parent of the post to get the correct value for the custom field.

Thanks,
Shane

#1517781

My issue is resolved now. Thanks.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.