Skip Navigation

[Closed] Might found a conditional issue

This support ticket is created 3 years, 4 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: Africa/Casablanca (GMT+01:00)

This topic contains 6 replies, has 2 voices.

Last updated by Jamal 3 years, 3 months ago.

Assisted by: Jamal.

Author
Posts
#2119851

Hi team,

I'm using some huge adaptative Content template to display recurrent elements in views and template..
I'm using the template both from direct post_type loop or from a relationship parent / child loop.

So, I had to changed those

[wpv-conditional if="( $(wpcf-f-country).id($film) ne '' )"] ... 

to

[wpv-conditional if="( $(wpcf-f-country).item(@film_projection.parent) ne '' )"] ... 

Right.

But, the good thing with old version ( < 3.0 ) is that $(...).id($film) was working both from direct or relationship loop ! It was handy.

Since Toolset 3.0, if you add a parent / child relation, and if you are not inside a parent / child loop, it returns nothing.

So, i tried this conditional, and might found an issue :

      [wpv-conditional if="( $(wpcf-f-country) ne '' )"]A[/wpv-conditional]
      [wpv-conditional if="( $(wpcf-f-country).item(@film_projection.parent) ne '' )"]B[/wpv-conditional]
      [wpv-conditional if="( $(wpcf-f-country) ne '' ) OR ( $(wpcf-f-country).item(@film_projection.parent) ne '' )" debug="true"]C[/wpv-conditional]
 

My ideas was to evaluate both, and then display in condition.

From direct loop, A is printed.
From relationship loop, B and C is printed.

Miss C from direct loop to be printed, right ?

Best regards,
Wilhem

#2122011

Hi team,
Can you check this ?

Best regards,
Wilhem

#2123219

Hello Wilhem and thank you for contacting Toolset support.

I am really sorry, but I am not sure to understand what you mean. Can you allow me temporary access to your website to check it? Or would you like to reproduce this on a test site with a minimal example? If yes, this is the link to my test site, and I'll set your next reply to be private if you want me to check your website. I'll need to know what view, and what content template.
hidden link

#2126215

I'm sorry Jamal, I'm now currently in vacations ; you can reproduce very easily this issue :

— Two PT : Books and writers
— One-to-many relation between books and writers ( writers wrote many books )
— You create a view querying all writers
— You can create a sub view querying all books called by the previous view
— Finally, the last view call a template in loop ( here conditionals fails )

I might be able to give you access today if I received the authorization.

Best regards,
Wilhem

#2126523

Hello Wilhem, I tried to reproduce the issue but it did not appear.

This is what I prepared so far:
- Writers' view: hidden link
- Books' view: hidden link
- Published here hidden link

Please check it from your side, maybe I missed something!

On the other hand, I have activated a private reply to let you share credentials to your website if that's possible.

#2126697

Hi Jamal,

I just sent you a message,

Best
Wilhem

#2130317

Hello Wilhelm, I am really sorry, but I am missing something to clearly see the bug. First of all, I don't see the related posts. Check this screenshot hidden link

I also need to understand how the content template is being used. I checked the theme's files(single-film.php) but I could not find where it is used.

Also, The Films-Projections is a one-to-many relationship, this means that we can't get the information's of the projections, inside the film, using only shortcodes. We need a view. Because projections are children, and they may be more than just one.
We can get the information from a film inside a project using a shortcode because it is guaranteed to have only one parent.

Can you please explain, for an example(The animals' film) in steps, with screenshots when possible:
1. I go to xxx
2. I do xxx
3. I expect to have xxx
4. Instead I get xxx

The topic ‘[Closed] Might found a conditional issue’ is closed to new replies.