Skip Navigation

[Resuelto] Views conditional newline

This support ticket is created hace 6 años, 10 meses. 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.

This topic contains 1 respuesta, has 1 mensaje.

Last updated by christerA hace 6 años, 10 meses.

Autor
Mensajes
#520460

Hi.

I'm calling a few Views, like this:

[wpv-conditional if="( '[wpv-found-count]' ne '0' )"]
[wpv-view name="show-thetown" city="1"]
[/wpv-conditional]
[wpv-conditional if="( '[wpv-found-count]' ne '0' )"]
[wpv-view name="show-thetown" city="2"]
[/wpv-conditional]
[wpv-conditional if="( '[wpv-found-count]' ne '0' )"]
[wpv-view name="show-thetown" city="3"][/wpv-conditional]

And i want the result to be displayed, like:
Town 1 information...
Town 2 information...
Town 3 information...
But not if the Views result is empty.

Everything works, except even though it is empty is inserts a newline. I have about 20 Views i'm calling. So there are lots of newlines.

I'm using Visual Composer in the template, is that the problem? I have no br tags in my Views template, but when i inspect in the browser, there is a br tag in every one, including the empty ones.

Or are there a better way to call the same View multiple times but with different shortcode parameters?
In some kind of loop?

#520487

Hi.

Solved it by surrounding the text with wpv-autop.

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