I am trying to:
Schow field='location-land' item='@veranstaltung-location.child' in the adress to the right just if it is not equal 'Deutschland', The adress is a field in a related post type. I can display it, but i can't use it in the conditional output, as i can do with the classic editor.
Link to a page where the issue can be seen:
hidden link
I expected to see:
Instead, I got:
Hi,
Thank you for contacting us and I'd be happy to assist.
To suggest the best way forward, I'll need to see exactly how and where this conditional block is being used, in the admin area.
Can you please share temporary admin login details, along with the link to a page where you've inserted this conditional block?
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
regards,
Waqar
Hi,
Thank you for sharing the admin access.
I've performed some tests on my website, with a similar setup and the conditional block works as expected.
( ref: https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-shortcodes-in-conditions/ )
Example:
[wpv-conditional if="( '[types field='location-land' item='@veranstaltung-location.child'][/types]' ne 'Deutschland' )"]
Location is not Deutschland
[/wpv-conditional]
[wpv-conditional if="( '[types field='location-land' item='@veranstaltung-location.child'][/types]' eq 'Deutschland' )"]
Location is Deutschland
[/wpv-conditional]
Note: for sharing private information like a website's access information, you can use the "Site access & Duplicator" section, while creating a new forum ticket.
( screenshot: hidden link )
If you'd like to remove private information from any of your previous support threads, you're welcome to let us know and we'll have it updated.
regards,
Waqar
your working with the classic editor in a view, but i'am working in a template with the block-editor and a "Fields and Text" block!
Check my "Veranstaltungen" Template, right column, the "Fields and Text" block ...
Ok I made it work. It's just possible using the 'HTML' editor of the "Fields and Text" block and not the "Visual" editor.
[wpv-conditional if="( '[types field='location-land' item='@veranstaltung-location.child'][/types]' ne 'Deutschland' )"][types field='location-land' item='@veranstaltung-location.child'][/types][/wpv-conditional]
Looks like the Blocks editor don't supports all feature of the classic editor ;( Anyway I think supporting blocks is a great step for Toolset . Lot's of people are lamenting that they never will use blocks, but i think it's the right way!
Thanks for the update and glad that it works.
During my tests inside the new blocks editor, it worked for me from the custom HTML block as well as the Fields and Text block (in HTML mode), just as you noted.
For complex nested conditional blocks such as this one, you can use any of these methods, as visual mode may not recognize/process it correctly.
Thank you for the kind words and support for the Toolset Blocks and we'll continue improving it based on the user feedback and suggestions.
So it would be great to handle conditional relation to parent types directly in the "Visual" mode. Keep up the good work with blocks.