Skip Navigation

[Resolved] Conditional Logic custom fields not appearing

This thread is resolved. Here is a description of the problem and solution.

Problem:

I have a column class of one-third to two-thirds as you can see. I want to set the conditional logic so that if there isn't an image added to [types field='creative-team-member-image' title='%%TITLE%%' alt='%%ALT%%' align='center' size='custom' width='250px' height='250px' resize='proportional'][/types] then the [types field="creative-team-member-description"][/types] becomes full width.

Solution:

I suggest you try to follow our document to setup the wpv-conditional shortcode, For example:

https://toolset.com/forums/topic/conditional-logic-custom-fields-not-appearing/#post-1232013

Relevant Documentation:

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

This support ticket is created 5 years, 9 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/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by bryanC-2 5 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#1231944

Tell us what you are trying to do?

On the development site, hidden link I am creating a shows content template using a shows CPT with custom fields and repeatable custom fields. hidden link

On my Loop item in Crew Bios template hidden link I have a column class of one-third to two-thirds as you can see. I want to set the conditional logic so that if there isn't an image added to [types field='creative-team-member-image' title='%%TITLE%%' alt='%%ALT%%' align='center' size='custom' width='250px' height='250px' resize='proportional'][/types] then the [types field="creative-team-member-description"][/types] becomes full width. As you can see here, hidden link The content goes two-thirds only because there is no image.

When I highlight [types field='creative-team-member-image' title='%%TITLE%%' alt='%%ALT%%' align='center' size='custom' width='250px' height='250px' resize='proportional'][/types]
Or
[types field="creative-team-member-description"][/types]
and click "conditional output" the custom fields aren't listed in the available fields.

Is there any documentation that you are following?

Yes your video on conditional logic here. https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

I've created a user account for you in so you can go into the site if needed.

...

One other minor thing. This is the first time I have created a page this complex with Toolset. I have never used repeatable fields. "At a glance" am I doing it the right way? I'm not used to putting so many views in a content template hidden link

It works and is fairly fast, so I assume I am doing it right. This is what I gather from the reference material.

Thanks a bunch.
I do love your product.

Bryan

#1232001

Hello,

Thanks for the details, I have edited your post to hide the website credentials, and I am checking it in your website, will update here if there is anything found.

#1232013

Here are what I found:
Q1) I want to set the conditional logic so that if there isn't an image added ...

I suggest you try to follow our document to setup the wpv-conditional shortcode,
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/

I have done below modification in your website, edit the post view "Crew Bios":
hidden link

In section "Loop item in Crew Bios", change the shortcode to:

...
[wpv-conditional if="( $(creative-team-member-image) ne '' )"]
  <div class="team-member-image one-third first">
  	[types field='creative-team-member-image' title='%%TITLE%%' alt='%%ALT%%' align='center' size='custom' width='250px' height='250px' resize='proportional'][/types]  
  </div>
  <div class="team-member-bio two-thirds">
  	[types field="creative-team-member-description"][/types]
  </div>
[/wpv-conditional]
[wpv-conditional if="( $(creative-team-member-image) eq '' )"]
  <div class="team-member-bio three-thirds">
  	[types field="creative-team-member-description"][/types]
  </div>
[/wpv-conditional]
...

Please test it again, check if it is what you want, for example:
hidden link

Q2) "At a glance" am I doing it the right way?
Yes, I think you are in right way.

#1233353

Thanks for the help
Bryan