Skip Navigation

[Resolved] I have an issue with toolset conditional outputs and with some custom shortcoede

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 4 replies, has 3 voices.

Last updated by garenM 1 year, 10 months ago.

Assisted by: Minesh.

Author
Posts
#2388825
Screenshot 2022-06-20 082449.jpg
Screenshot 2022-06-17 112400.jpg
Screenshot 2022-06-17 112454.jpg

I have an issue with toolset conditional outputs(doesnt output anything in astra layouts when i use fields and text block from toolset) and with some custom shortcoede(there are some errors with the attributes of the shortcode. am adding as attributes id and slug and if the shortcode is like that->[getProductImage id="[wpv-post-id]" slug="[wpv-post-slug]"] i will get the result and at the end i will get that-> " slug="[some-slug]"] )

hidden link

#2388987

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I will have to check whats going wrong with your setup and for that I will require admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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.

#2388993

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi there

I followed the link you shared and it's not obvious that there is anything wrong on the page.

Likewise, I'm not sure what we are supposed to be looking at on your screenshot with the beer bottles.

In the screenshot of the markup and shortcodes, the one thing I notice is a problem with your use of single or double quotes.

With the wpv-conditional shortcode, the if attribute details appear within double quotes. You cannot then use double quotes inside the if condition, because that brings the if attribute to a close prematurely.

Try changing the output="url" attribute of the wpv-post-featured-image shortcode to use single quotes, i.e. output='url'

#2389149

Minesh
Supporter

Languages: English (English )

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

I've created the following content template and added the shortcode to it:
=> hidden link

[getProductImage id='[wpv-post-id]' slug='[wpv-post-slug]']

I've created another content template that holds the conditionals:
=> hidden link

[wpv-conditional if="( '[wpv-post-featured-image output='url']' ne '' )"][wpv-post-featured-image size="full"][/wpv-conditional]
[wpv-conditional if="( '[wpv-post-featured-image output='url']' eq '' )"]<img src="/wp-content/uploads/2022/06/thumbnail_Composition-Default-Fallback.jpg" class="product-image wow animate__animated animate__fadeIn" data-wow-delay="0.5s" data-margin-top="110" data-sticky-for="1199" style="visibility:hidden;">[/wpv-conditional]

And then I've added those content templates to your custom layout:
=> hidden link

[wpv-post-body view_template="show-product-image-shortcode"]
[wpv-post-body view_template="display-conditionals"]

I can see its working as expected on the frontend:
- hidden link

#2401703

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.