Skip Navigation

[Resolved] Arbitrary breaks between shortcode lines on front-end

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 12 replies, has 2 voices.

Last updated by jonathanR-5 2 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#2112717

Below is some of the code to display these pages: hidden link

[wpv-conditional if="($(title) ne '')"][types field='title' show_name='false'][/types][/wpv-conditional]
[types field='additional-title' show_name='false'][/types]
[types field='ph-d' show_name='true'][/types]
[types field='area-chair' show_name='true'][/types]
[types field='primary-area' show_name='true'][/types]
[types field='secondary-area' show_name='true'][/types]
[types field='home-department' show_name='true'][/types]

If you look at the source code, there are arbitrary break tags and <p> tags surrounding more than one line. Any way to override this behavior? I've tried deleting any line breaks in the View block editor which didn't solve the issue. I also tried surrounding each line with a <p> tag hoping to override the ones that are generated by default. Please advise.

#2113137

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Can you please share the screenshot and markdown what additional space you would like to remove?

*** 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.

#2119243
screen2.jpg
screen.jpg

Please see the two screenshots attached (extra spaces outlined in red). One of the breaks I'm referring to on the front-end and the extra <br> tags generated in the html. As I demonstrated in my previous message, there are no extra breaks between the shortcodes in the block editor. Please advise.

#2120059

Minesh
Supporter

Languages: English (English )

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

I need to check whats going wrong with your setup. Would you mind to share admin access details?

*** 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.

#2120207
screen.jpg

See the screenshot attached. That is my "setup". I'm not able to give you access at this time. Please help me troubleshoot this via screenshots and answers to questions you have.

#2120231
screen.jpg

Not sure if my response went through. Here is how the shortcodes are setup. I'm unable to give you access to the site at this moment. Please advise.

#2120893

Minesh
Supporter

Languages: English (English )

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

Ok. thanks for the screenshot. I see you are using the shortcode block that holds the Types shortcode.

What if you try to wrap all the Types shortcode with [wpv-noautop] shortcode:
=> https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-noautop

For example:

[wpv-noautop]
provider: [wpv-post-field name="provider_type"],
industry: [wpv-post-field name="industry"],
featured: [wpv-post-field name="featured_image"]
[/wpv-noautop]
#2121579
Screen Shot 2021-07-21 at 2.42.16 PM.png
Screen Shot 2021-07-21 at 2.42.27 PM.png

That didn't work, see attached screenshots. puts everything wrapped inside of it, on one line.

#2121905

Minesh
Supporter

Languages: English (English )

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

What if you try to use "Fields and Text" block? Does that helps?

There can be many possibilities - what theme/plugin you are using, if there is possible conflict?

What if you try to remove conditional statement for testing purpose - Do you see any difference?

#2122505

None of those solved the issue. The issue is that when a field is empty, it creates a space there for it anyway. So for example, if you look at my screenshots above, in the shortcode, you will see secondary-area right after primary-area. If a faculty does not have a secondary area, there is an extra space created anyway for that field on the front-end. So unless you know of a conditional statement that would take care of that, I don't see another way. It seems to be a bug in your code. Please fix this!

#2122951

Minesh
Supporter

Languages: English (English )

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

You can check empty-nonempty content of the custom field using the [wpv-conditional] shortcode.

What if you wrap the primary and secondary field with conditional shortcode. That is the best workaround I can offer:

[wpv-conditional if="('[types field='primary-area' output='raw'][/types]' ne '')"]
[types field='primary-area' show_name='true'][/types]
[/wpv-conditional]

[wpv-conditional if="('[types field='secondary-area' output='raw'][/types]' ne '')"]
[types field='secondary-area' show_name='true'][/types]
[/wpv-conditional]
#2123487

That didn't work either. Can this issue be escalated to a higher level support?

#2123635

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.