Hi, it's just something I've noticed. It is not possible to apply CSS classes to conditional blocks. The natural thing is within the conditional block to have another container to sort the content, but it can be useful to have the ability to apply classes to the entire conditional set
Greetings
Hi there,
To achieve such a thing you need to enable the legacy view and use that method:
- Go to "Toolset > Settings > General".
- Find the "Editing experience" section.
- Check the "Show both the legacy and Blocks interface and let me choose which to use for each item I build" checkbox.
- Reload the browser page.
- Go to the newly added "Toolset > Views" menu.
- There you will be able to edit the views.
For more information:
https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/
Now you will have access to HTML code and you can use the conditional shortcode to add inside the class attribute of an HTML tag to change the class depending on the result of the conditional:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-conditional
Thank you.
That's interesting to know, I just want to report a smaller or simpler problem in modern blocks
Classes that apply to that block don't work. I understand that it's something very specific and probably not that relevant to implement (since most are going to create a container inside anyway)
In my particular case, at some point I considered "marking" certain blocks in the loop that contain a certain condition and then apply display none to them by CSS. But there are other ways to get to that and I have already created a specific ticket for the problem I am facing.
Thank you so much
My issue is resolved now. Thank you!