Skip Navigation

[Resolved] Conditional weird behaviours on output editor

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

Last updated by philippeK 5 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#1403673
Screenshot 2019-12-10 at 08.50.17.png
Screenshot 2019-12-10 at 08.50.55.png
Screenshot 2019-12-10 at 08.50.34.png

I am trying to:
Display video of a custom post type

Link to a page where the issue can be seen:
hidden link

Simple view that display a custom post type, for each item it does that:

<div class="embed-responsive embed-responsive-16by9">  
	<iframe src="<em><u>hidden link</u></em> field='video-url-livre' output='raw'][/types]?color&autopause=0&loop=0&muted=0&title=0&portrait=0&byline=0#t="></iframe>
</div>
<h4>[wpv-post-title]</h4>

the output editor does that:

[wpv-conditional if="( '[wpv_user_connected]' eq 'no')" debug="true"]
  [wpv-filter-meta-html]
  [wpv-layout-meta-html]
[/wpv-conditional]

Now this is where it gets weird... If I put:
[wpv-filter-meta-html]
[wpv-layout-meta-html]
outside of the conditional, it displays correctly the video as seen in the image attached. But If I put the code in the conditional, I get some weird characters like [wpv-filter-meta-html] [wpv-layout-start] [wpv-items-found] on the top of the page.
What is even more weird is that it seems that if I have less then 8 to 10 videos to show, there is no problem. OR if put this for the each item:

[types field='video-url-livre' output='raw'][/types]
<h4>[wpv-post-title]</h4>

there is no problem.

Here is the debug output, this output is shown ONLY if the user is connected, if not connected it doesn't show up:
####################
wpv-conditional attributes
####################
Array
(
[if] => ( 'yes' = 'no')
[debug] => true
)

####################
Debug information
####################
--------------------
Original expression: ( 'yes' = 'no')
--------------------
After replacing 1 general variables and comparing strings: ( 'yes' = 'no')
Comparing yes to no

#1404425

Shane
Supporter

Languages: English (English )

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

Hi Philippe,

Thank you for getting in touch.

Could you let me know exactly what you are trying to achieve so that I can best advise ?

Please let me know.
Thanks,
Shane

#1404483

Hello
I want to display a custom post type content and some other content if a user has bought a product. I have the shortcode that check that, I would like to display the view only if he has bought that. If the user is not connect I will display a login form and some text.
I use elementor so I thought that I would do the code on the view. I guess I could use toolset block but I'm not really at ease with it yet.

#1404875

Shane
Supporter

Languages: English (English )

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

Hi Philippe,

Thank you for the clarity.

I believe it would be best if you wrapped the conditional around the view shortcode itself.
Example.


[wpv-conditional if="( '[wpv_user_connected]' eq 'no')" debug="true"]
 [wpv-view name='my-name']
[/wpv-conditional]

This way the view only gets loaded if the correct condition is met by the conditional.

Please let me know if this change resolves the issue.

Thanks,
Shane

#1404981

ok, this is what I finally did, I created a page and use your Toolset Blocks to add the view with a conditional. I get where you are going Toolset Blocks, it would be awesome to have it work inside Elementor as part of their composant.

#1404983

My issue is resolved now. Thank you!