Skip Navigation

[Resolved] Excessive Whitespace is a serious issue

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

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by Waqar 2 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#2497473

Excessive Whitespace is a serious issue in the views and templates.

I worked with other languages like PHP and ColdFusion, they had ways to manage that. Is there a way to manage it here rather than having to make all my logic one-liners and then have to format them again when editing so it's readable?

I have all views set to "Manual paragraphs" which I assume means that I create the layout/tags and not Toolset.
I have found it still does create empty breaks and paragraphs.

In ColdFusion it would not put out anything else than that what was wrapped within <cfoutput> not sure if that's something you could look at? [wpv-output][/wpv-output] and nothing within that would not be output to the screen.

#2497479

Looks like I should have read the documentation better and that this might do the trick: [/wpv-noautop]

#2500903

Well, I spoke too soon, it's not resolved. Whitespace is still an issue, even with a view like this.
[wpv-noautop][wpv-layout-start][wpv-items-found]<!-- wpv-loop-start --><wpv-loop>[wpv-post-id]</wpv-loop><!-- wpv-loop-end -->[/wpv-items-found][wpv-no-items-found][wpml-string context="wpv-views"]0[/wpml-string][/wpv-no-items-found][wpv-layout-end][/wpv-noautop]

#2500905

Well, I spoke too soon, it's not resolved. Whitespace is still an issue, even with a view like this.
[wpv-noautop][wpv-layout-start][wpv-items-found]<!-- wpv-loop-start --><wpv-loop>[wpv-post-id]</wpv-loop><!-- wpv-loop-end -->[/wpv-items-found][wpv-no-items-found][wpml-string context="wpv-views"]0[/wpml-string][/wpv-no-items-found][wpv-layout-end][/wpv-noautop]

#2501239

The whitespace issue requires me to do silly things like this to my code so I can't easily edit it later.

[wpv-layout-start]
[wpv-items-found]<!-- wpv-loop-start --><wpv-loop>[wpv-conditional if="('[wpv-attribute name='field']' eq 'title-link')"][wpv-post-link item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'title')"][wpv-post-title item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'body')"][wpv-post-body view_template="None" item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'set-up')"][wpv-post-field name="wpcf-set-up" item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'concentric-phase')"][wpv-post-field name="wpcf-concentric-phase" item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'goal')"][wpv-post-field name="wpcf-goal" item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'eccentric-phase')"][wpv-post-field name="wpcf-eccentric-phase" item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'form')"][wpv-post-field name="wpcf-form" item="$parent"][/wpv-conditional]</wpv-loop><!-- wpv-loop-end -->[/wpv-items-found]
[wpv-no-items-found][/wpv-no-items-found]
[wpv-layout-end]

#2501243

Hi,

Thank you for contacting us and I'd be happy to assist.

To make the view's output minimal and avoid any extra spaces, you can follow these steps:

1. Enable the checkbox for the option "Disable the wrapping DIV around the View".
( it is right above the "Output Editor" section - example screenshot hidden link )

2. From the "Output Editor" section of the view, remove the shortcode:


[wpv-filter-meta-html]

I hope this helps and please let me know if you need any further assistance with this.

regards,
Waqar

#2501255

On any view that the issue is present, I already have the checkbox ticked to disable the DIV.
I just formatted the shortcode again (so it's readable) and remove the filter-meta as you suggested, it made no difference, lots of whitespace still.

This is how much whitespace it added " Bodyweight Single-Leg Hip Hinge ". After the solution below, which is a crazy solution, I get "Bodyweight Single-Leg Hip Hinge"

The only solution to removing the whitespace is by formatting my shortcodes like so

[wpv-layout-start][wpv-items-found]<!-- wpv-loop-start --><wpv-loop>[wpv-conditional if="('[wpv-attribute name='field']' eq 'title-link')"][wpv-post-link item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'title')"][wpv-post-title item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'body')"][wpv-post-body view_template="None" item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'set-up')"][wpv-post-field name="wpcf-set-up" item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'concentric-phase')"][wpv-post-field name="wpcf-concentric-phase" item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'goal')"][wpv-post-field name="wpcf-goal" item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'eccentric-phase')"][wpv-post-field name="wpcf-eccentric-phase" item="$parent"][/wpv-conditional][wpv-conditional if="('[wpv-attribute name='field']' eq 'form')"][wpv-post-field name="wpcf-form" item="$parent"][/wpv-conditional]</wpv-loop><!-- wpv-loop-end -->[/wpv-items-found][wpv-no-items-found][/wpv-no-items-found][wpv-layout-end]

#2501483

Thanks for writing back.

Toolset views don't offer any built-in feature to automatically remove the empty spaces from the start and end of the output coming from the "Loop Editor" section.

So, in this case, removing the empty spaces and line breaks from that section (as you noted) is the way to go.