Skip Navigation

[Resolved] Passing argument to conditional block inside page block editor

This support ticket is created 3 years, 5 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
- 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 5 replies, has 2 voices.

Last updated by ericL-2 3 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#2148971
screenshot-www.businesshood.com-2021.08.23-01_16_48.jpg

HI,

I created a conditional block to only display its content inside same page when the conditional block parameter value is the same as a shortcode with argument/attribute placed inside a Classic block. Similar to how using [wpv-view argument='']

However, I could not find out how to do it. Is there any workaround to make the conditional block with parameter?

#2149557

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

To get the value of the view's shortcode attribute you will have to use the shortcode: [wpv-attribute]
=> https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-attribute

Which is not supported in blocks, if you want to use that I suggest you should add a "Fields and Text" block and add the conditional shortcode:
=> https://toolset.com/documentation/legacy-features/views-plugin/#conditional-output-in-views

#2149637

Ok. How to set attribute value for [wpv-attribute] inside 'Field and Text' block?
How what's code to write in advanced condition in condition block that will display content when that attribute is not empty?

Thanks

#2149641

Minesh
Supporter

Languages: English (English )

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

Can you please share problem URL and admin access details and tell me what view's shortcode attribute you want to check for not empty value and what section you want to display conditionally?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2149711

Minesh
Supporter

Languages: English (English )

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

I see you are using the block view mode and using block view mode its not possible to use the view's shortcode attribute.

Even I do not see name, phone, email where you places as there are multiple views added on the page.

Can you please tell me your usecase to display name, phone, email using conditoinals and tell me where exactly you want to place within what view? or outside the view? Few screenshots would help to see where exactly you want to display what.

#2149939

Hi Minesh,

I made a solution by creating shortcode [setAdsUserInfoVisible visible='1']
and function isAdsUserInfoVisible() in conditional block .

My issue is resolved now. Thank you!