Hi. This works great I love it. My view is outputting a ton of whitespace before and after the rendered view field. On the view itself I have clicked "remove whitespace" from the rewrite results so I'm pretty sure it's getting sent in without the whitespace. This would be a really nice feature to add. Thanks!

Comments

rinasek’s picture

I had similar problem this week and views output was giving me a lot of leading whitespaces and couple of trailing white spaces.
Problem is that part of "whitespaces" is not exactly whitespace only.

First you have Carrige return and after that you have Line feed . After that there is only white space. I guess that views "Remove whitespaces" option is doing what it says removing white spaces, but problem is that before whitespace you have CR and LF.

This is how i solved it.

  1. Create tpl.php for that view (chose style output)
  2. Edit that view tpl.php and find lines that are printing rows, should be <li class="<?php print $classes_array[$id]; ?>"><?php print $row; ?></li>.
  3. Relace last part <?php print $row; ?> with <?php print trim($row,"\r\n "); ?> and test.

This solved all my problems, removed both leading and trailing whitespaces.

Hope this helps.

damiankloip’s picture

Status: Active » Fixed

Going to mark this as fixed. This is not really a VFV issue, more of a views issue I think.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

lionguard’s picture

Issue summary: View changes
StatusFileSize
new2.1 KB

I ran into this same issue, but took a different approach of making a small patch to the module which enables whitespace and/or html to be stripped out of the final rendered view - see attached for the patch file

matis1718’s picture

StatusFileSize
new141.1 KB

hi, i have big trouble with the blank space at the top of the site. i change parallax and all the time the site broken. which file i need to edit? for example the site like this.
pls can you help me?

dmaya’s picture

I am having the same issue at @matis1718 and am not sure that this is the right place for the question. Lots of blank whitespace at the top of my homepage only. Any advice?

abelaguado’s picture

HI lionguard. Your patch works great!