Skip Navigation

[Resolved] Cant select "from a related" post type at conditional output

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

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/Karachi (GMT+05:00)

Author
Posts
#1489577

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:

#1489903

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

#1496043

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

#1496575
Bildschirmfoto 2020-02-06 um 17.34.20.png

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!

#1497501

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.

#1497569

So it would be great to handle conditional relation to parent types directly in the "Visual" mode. Keep up the good work with blocks.