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.
Looks like I should have read the documentation better and that this might do the trick: [/wpv-noautop]
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]
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]
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]
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:
I hope this helps and please let me know if you need any further assistance with this.
regards,
Waqar
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]
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.