Skip Navigation

[Resolved] Conditional display for content templates edited in Gutenberg

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

Problem: I want to display blocks based on a condition.

Solution: Toolset Blocks has a Conditional Block that can conditionally display content.

Relevant Documentation:
Take a look at our lesson "Display Content Conditionally in WordPress".

This support ticket is created 5 years, 8 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.

Our next available supporter will start replying to tickets in about 4.46 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1223512

I am trying to use Gutenberg to edit content-templates, and in my content template I have some conditional display.

Now I would like to be able to wrap one or more Gutenberg blocks into that conditional display.

How can you achieve this in Gutenberg (or the block editor as its named now)

#1223607

Hi, we're working on some updates that will expand the Toolset integration in the block editor, but for now it's not really easy to add conditional display at the block level. In very simple cases you can use a shortcode block to insert the wpv-conditional using your own code, but it's not well integrated into the GUI and in complex cases it will break down fairly quickly. At this time it's best to use the traditional Content Template editor to implement conditional HTML.