Skip Navigation

[Resolved] Conditional Block

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 1 reply, has 2 voices.

Last updated by Minesh 1 year, 5 months ago.

Assisted by: Minesh.

Author
Posts
#2637415

Hi,

Related to this post: https://toolset.com/forums/topic/display-shortcode-conditionally-based-on-url/

I also want to display content on a certain url, your answer in this post may be good, maybe not. Nowhere did you explain where to use these short codes or functions or whatever.

Where does this go:

[wpv-conditional if="( LEFT('[wpv-post-url item="$current_page"]',24) eq '<u>hidden link</u>' )" debug="true"]
The current URL begins with <u>hidden link</u>
[/wpv-conditional]
[wpv-conditional if="( LEFT('[wpv-post-url item="$current_page"]',24) eq '<u>hidden link</u>' )" debug="true"]
The current URL begins with <u>hidden link</u>
[/wpv-conditional]

In advance part of conditional block, in shortcode block or where?

Keep in mind that when you give answers, we users who are new to toolset don't know what you know. I tried all the possible options that came to my mind where to use this code from your answer and none of them work.

Your YouTube channel is very poor, for conditional block you have only one video and in that video I did not see anywhere where I could use your answer.

hidden link

Also, the main post where you describe the conditioning block is also nowhere explained where these codes of yours that the support gives are used.

https://toolset.com/course-lesson/using-toolset-conditional-block/

Now I will ask you one more time, and I hope you will give a clear answer this time.

How can I set the conditional options so that the content in the conditional block is displayed only on urls that contain XXXXX inside of url?

#2637465

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Sorry to hear you that and we feel its not good I understand.

First of all, let me clear few things. You can add conditional display two ways.
- Add conditional block (which offers limited options with GUI)
- Add conditional shortcode (you will have more freedom to customize it)
-- if you are using conditional shortcode then you should add the conditional shortcode (if you are using blocks interface to build your content template etc..) then you should add the conditional shortcode by adding "shortcode" or "Fields and Text" block and add the conditional shortcode you shared to "shortcode" or "Fields and Text" block.

If you are using Conditional block here is the post that might help you:
- https://toolset.com/2021/08/5-advanced-uses-of-toolsets-conditional-block-in-wordpress/

But as you share the conditional shoartcode with your initial post and you want to know where you should add that, here is the doc you should refer and add the conditional shortcode to "Fields and Text" block or "Shortcode" block.
- https://toolset.com/documentation/legacy-features/views-plugin/#conditional-output-in-views

There is no native way to check whats inside the URL so that the solution you are referring you might use and would be useful or
You can also use custom functions that should return the custom value and based on that you can add your conditional check. Please check the following Doc:
- https://toolset.com/documentation/programmer-reference/views/using-custom-functions-in-conditions/

If you have any queries please let me know.

In addition to that there are more resource and playground we offer than you think.

I would like to inform you that Toolset offers free test platform http://www.discover-wp.com where we offer ready made sites build on top using Toolset.

Here are the reference sites we offer:
- https://discover-wp.com/site-templates/

You can install any reference site and check how those build that will give you further idea. In addition to that we offer step by step courses that you should follow as well:
- https://toolset.com/course/

You can even install any of the reference site we offer on http://www.discover-wp.com on your local machine using the framework installer plugin and play with the reference site to know how those sites are build using Toolset:
- https://toolset.com/course-lesson/using-framework-installer-to-install-reference-sites/