Skip Navigation

[Resolved] Hiding WP Bakery rows when content is conditiional

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

Problem:

I'm trying to hide a row which contains a conditional statement/data. I tried to switch back to general editor for adding the conditional statement so the row isn't visible anymore, that works. But after switching back to WP Bakery for further editing, WP Bakery adds extra rows for the conditional statement and also one for the closing tag.

Solution:

You can create a Views content template, put the [wpv-conditional] shortcode into this content template, then display the content template shortcode where you want using [wpv-post-body] shortcode, for example:

[wpv-post-body view_template="my-content-template-slug"]

Relevant Documentation:

https://toolset.com/documentation/user-guides/view-templates/

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

Last updated by jelle-jacobd 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#1161368

Tell us what you are trying to do?
I'm trying to hide a row which contains a conditional statement/data. I tried to switch back to general editor for adding the conditional statement so the row isn't visible anymore, that works. But after switching back to WP Bakery for further editing, WP Bakery adds extra rows for the conditional statement and also one for the closing tag. Is this normal behaviour or is there a smarter way to do this. If I don't use this extra conditional statement to rows stays in place and in that case is adding extra margin or a white space. I would like it to be totaly gone when there no content to show.

Thanks.

#1161403

Hello,

I suggest you create a Views content template, put the [wpv-conditional] shortcode into this content template, then display the content template shortcode where you want using [wpv-post-body] shortcode, for example:
[wpv-post-body view_template="my-content-template-slug"]
https://toolset.com/documentation/user-guides/view-templates/

#1161718

My issue is resolved now. Thank you!