I want to just display lots of fields (only 50% are populated). The problem is that the output adds line breaks if there is no content. I looked at forums and they say that the content template should be set to raw, which I have done
On the template page is have set the output mode to Manual paragraphs, but it still gives breaks
here is the code a snippet of the code.............
[wpv-conditional if="( $(wpcf-bathrooms) ne '' )"]Bathrooms: [types field='bathrooms' output='raw'][/types][/wpv-conditional]
[wpv-conditional if="( $(wpcf-square-metres) ne '' )"]Size: [types field='square-metres' output='raw'][/types]m2[/wpv-conditional]
[wpv-conditional if="( $(wpcf-postcode) ne '' )"]Postcode: [types field='postcode'][/types][/wpv-conditional]
[wpv-conditional if="( $(wpcf-building-name) ne '' )"]Building Name: [types field='building-name'][/types][/wpv-conditional]
[wpv-conditional if="( $(wpcf-location) ne '' )"]Location: [types field='location'][/types][/wpv-conditional]
This code is set within a beaver builder template.
Hi, it looks like the li tags are placed outside the conditionals, based on the code I can see here. Without being able to see the problem on the front-end of the site, I'm just guessing though. My first suggestion is to move the list item tags inside each conditional:
[wpv-conditional if="( $(wpcf-bathrooms) ne '' )"]<li>Bathrooms: [types field='bathrooms' output='raw'][/types]</li>[/wpv-conditional]
If that does not solve the problem, I'll need to see the output on the front-end of your site to make some other recommendations. Please provide a URL where I can see the problem.
My issue is resolved now. Thank you!
I just started to use the block editor for everything