Skip Navigation

[Resolved] Unable to switch to advanced conditional format

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by Minesh 1 year, 4 months ago.

Assisted by: Minesh.

Author
Posts
#2647163
Screenshot 2023-09-25 at 12.44.10.png
Screenshot 2023-09-25 at 12.54.34.png

Tell us what you are trying to do?
Use advanced conditional block on a Content Template (rather than the basic conditional format).
I edit the template, select the post type and click 'edit conditions'.

I then click the 'advanced editor' option to toggle the advanced editor. It switches on as expected.

But if I navigate away from that condition - or save the page and return it always defaults back to the basic (IE: advanced is toggled off).

I now can't get into the content template at all. It's throwing a critical error (see attached).
I also can't delete or trash this content template anymore.

How can I get rid of it and start again?

Do you have any better instructions / guides for the advanced conditions?

Thanks

Karl

#2647207

I'm still struggling getting anything conditional on a content template to work.

EG:
[wpv–conditional if="('1' eq '1' )"]This field has a value[/wpv–conditional]
This just literally prints out the text above - as if the conditional shortcode is completely missing.

Standard shortcodes are working fine:
[wpv-post-id]
[wpv-post-title]

But I can't for the life of me get the conditional code to work.

Theme is Divi Extra. No error logs -

#2647495

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You can add conditional display to content template either using conditional block or conditional shortcode.

Here is how you can use Divi with Toolset:
- https://toolset.com/course-lesson/using-toolset-with-divi/

If you want to go for advanced conditional usage then you should go for [wpv-conditional] shortcode.

For that you should add a content template in legacy mode from Toolset => Content Templates and name your content template and do not assign this content template to display with any post type:
=>https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/
(Please activate first legacy mode)

Then you should add the conditional shortcode and build the condition as requried:
- https://toolset.com/documentation/legacy-features/views-plugin/#conditional-output-in-views

Later you can add this content template to your desired place:

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

Where:
- Replace "your-content-template-slug" with original slug

More info:
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-conditional

#2647593

It looks like I was having an issue with the character encoding (most likely the quote marks. )

Maybe stemming from copying the conditional code on this page: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-conditional

Some kind of character encoding gremlins meaning that the quotes themselves are not being recognised.

I can have 2 lines of text that look identical - one works and the other doesn't. (Not curly quotes - they are 100% identical visually)

Using the legacy template and starting from the condition output button seems to ensure that the quotes are working OK.

The conditional shortcode works fine that way.